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

时间:2016-10-11 21:00:09   收藏:0   阅读:264

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)

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!