zoukankan      html  css  js  c++  java
  • vue为页面动态添加title

    var updateTitle = function(title) {
      document.title = title
      var mobile = navigator.userAgent.toLowerCase()
      if (/iphone|ipad|ipod/.test(mobile)) {
        var iframe = document.createElement('iframe')
        iframe.style.display = 'none'
        // 替换成站标favicon路径或者任意存在的较小的图片即可
        //iframe.setAttribute('src', 'static/user.png')
        iframe.setAttribute('src', 'static/images/icon1.png');
        var iframeCallback = function () {
          setTimeout(function () {
            iframe.removeEventListener('load', iframeCallback)
            document.body.removeChild(iframe)
          }, 0)
        }
        iframe.addEventListener('load', iframeCallback)
        document.body.appendChild(iframe)
      }
    }

  • 相关阅读:
    Java用户自定义函数
    JavaScript常用函数
    Javascript 流程控制
    Javascript基础
    CSS的继承和使用方式
    Python列表
    Python变量和简单数据类型
    CSS选择符
    CSS的基本语法
    Java环境变量搭建
  • 原文地址:https://www.cnblogs.com/apgy/p/7942440.html
Copyright © 2011-2022 走看看