如何获取浏览器的尺寸

我现在有一个留言本, 在1024 * 768 的屏幕显示正常,但是 在800 * 600 下面就显示有问题,页面整体太乱。 我想做一个检测页面,如果检测到用户的浏览器大小为 800 *600 就进入 页面1 如果 是1024 * 768 就进入页面 2 。请教高手,帮我解决,谢谢
---------------------------------------------------------------

1<script language="JavaScript">   
2<!--   
3var correctheight=600   
4if (screen.height>correctheight)   
5window.location.href='1024.htm'   
6else   
7window.location.href='800.htm'   
8//-->   
9</script>
Published At
Categories with Web编程
comments powered by Disqus