站内搜索: 请输入搜索关键词

当前页面: 开发资料首页Javascript 专题根据客户端的分辨率不同而重定向到不同网页的脚本

根据客户端的分辨率不同而重定向到不同网页的脚本

摘要: 根据客户端的分辨率不同而重定向到不同网页的脚本


我们知道,对于客户端分辨率的问题可以通过ASP在服务器端进行判断,我用Javascript脚本也可以完成这个功能。下面是源程序:

<script language="javascript">
if (window.screen){
var widths = screen.width;
url_640 = "default800.htm";
url_800 = "default800.htm";
url_1024 = "default1024.htm";
if(widths<740){
self.location.replace(url_640);
}
if(widths>=740 & w<835){
self.location.replace(url_800);
}
if(widths>=835){
self.location.replace(url_1024);
}
}
</script>

如果大家还有好的方法,请告诉我。

</td> </tr> <tr> <td vAlign=top align=left height="100%">
↑返回目录
前一篇: IE 对象浏览器
后一篇: [教程]JScript中的变量引用规则(一)