firefox 使用documet.url无法实现跳转
出处:
http://www.websbook.com/jsym/06/gjfirefox_iedbtdllqtzddyym_13020.html
Firefox 跳转
这段代码将会判断访问者的浏览器是否是firefox的,如果不是将跳转到firefox下载页面!
<html>
<script>
if(navigator.userAgent.indexOf("Firefox") != -1)
{
window.location = "http://www.websbook.com";
}
else
{
window.location = "http://www.mozilla.org/products/firefox/";
}
</script>
</html>
根据不同的浏览器跳转到对应页面
这段脚本根据不同的浏览器跳转到不同的页面
<html>
<script>
if(navigator.userAgent.indexOf("Firefox") != -1)
{
window.location = http://www.websbook.com;
}
else if(navigator.userAgent.indexOf("MSIE") != -1)
{
window.location = "http://www.websbook.com";
}
else if(navigator.userAgent.indexOf("Netscape") != -1)
{
window.location = "http://www.websbook.com";
}
else
{
window.location = "http://www.websbook.com";
}
</script>
</html>