在Wordpress中显示IE8,IE7,IE6的浏览器升级警告

问题描述 投票:0回答:2

我正在开发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
2个回答
1
投票

您可以使用IE条件评论:

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

0
投票

你可以试试这个

    <!--[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]-->
© www.soinside.com 2019 - 2024. All rights reserved.