完美解决微信端设置title失败问题

document.setTitle = function(t) {
document.title = t;
var i = document.createElement('iframe');
  i.src = '/favicon.ico';
  i.style.display = 'none';
  i.onload = function() {
  setTimeout(function(){
    i.remove();
  }, 0)
  }
document.body.appendChild(i);
}

setTimeout(function(){
  document.setTitle(‘hello!’)
}, 1000)

 

posted @ 2016-10-11 19:50  WhatsMax  阅读(554)  评论(0编辑  收藏  举报