JS 动态修改微信 iOS 标题

 1 var $body = $('body');
 2 
 3 document.title = 'the title you want to set';
 4 
 5 var $iframe = $("<iframe style='display:none;' src='/favicon.ico'></iframe>");
 6 
 7 $iframe.on('load', function() {
 8     setTimeout(function() {
 9         $iframe.off('load').remove();
10     }, 0);
11 }).appendTo($body);
12 
13 // ===============================================
14 
15 const iframeLoad = function (src) {
16     let iframe = document.createElement('iframe');
17     iframe.style.display = 'none';
18     iframe.src = src;
19     document.body.appendChild(iframe);
20     iframe.addEventListener('load', function () {
21         setTimeout(function () {
22             iframe.remove();
23         }, 0);
24     });
25 };

 

posted @ 2020-06-11 11:12  xlsdg  阅读(126)  评论(0)    收藏  举报