【问题标题】:Show browser upgrade warning for IE8, IE7, IE6 in Wordpress在 Wordpress 中显示 IE8、IE7、IE6 的浏览器升级警告
【发布时间】:2015-07-05 16:48:39
【问题描述】:

我正在开发 Wordpress 网站。但大部分功能在 IE8 浏览器中不显示。所以我打算显示浏览器升级警告,但它不起作用。任何人都可以帮助我。

<script> 
var $buoop = {vs:{i:9,f:15,o:12.1,s:5.1},c:2}; 
function $buo_f(){ 
 var e = document.createElement("script"); 
 e.src = "//browser-update.org/update.js"; 
 document.body.appendChild(e);
};
try {document.addEventListener("DOMContentLoaded", $buo_f,false)}
catch(e){window.attachEvent("onload", $buo_f)}
</script> 

【问题讨论】:

    标签: javascript html wordpress internet-explorer browser


    【解决方案1】:

    可以使用IE条件注释:

    <!--[if lt IE 9]>
    <script src="//browser-update.org/update.js"></script>
    <![endif]-->
    

    【讨论】:

    • 您可以从条件注释中加载您的 javascript 文件,我已经更新了答案。
    【解决方案2】:

    你可以试试这个

        <!--[if IE 5]>
    <script language="Javascript">
    <!--
    alert ("It looks like you aren't using Internet Explorer 7. To see our site correctly, please update.")
    //-->
    </script>
    <![endif]-->
    <!--[if IE 5.0]>
    !--
    alert ("It looks like you aren't using Internet Explorer 7. To see our site correctly, please update.")
    //-->
    </script>
    <![endif]-->
    <!--[if IE 5.5]>
    !--
    alert ("It looks like you aren't using Internet Explorer 7. To see our site correctly, please update.")
    //-->
    </script>
    <![endif]-->
    <!--[if IE 6]>
    !--
    alert ("It looks like you aren't using Internet Explorer 7. To see our site correctly, please update.")
    //-->
    </script>
    <![endif]-->
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多