首页 > IT基础架构 > 网络安全 > 让网页具备浏览器识别功能(转)
| < script language="Javascript" >
fun- ction testBrowser(){ ie=((navigator.appName=="Microsoft. Internet Explorer")&&&& (parseInt(navigator.appVision) >=4)) ns=((navigator.appName=="Netscape")&&&& (parseInt(navigator.appVision) >=4)) if(ie){self.location.href="index_ie.html";} if(ns){self.location.href="index_ns.html";} } < /script > |
同时,还必须在该页面的<body>中加入对程序的调用:
| < body onLoad="testBrowser()"
> </body> |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9650775/viewspace-922751/ ,如需转载,请注明出处,否则将追究法律责任。