screen.width
screen.height
如:
<script>
alert('分辨率为'+screen.width+'*'+screen.height);
</script>

解决方案 »

  1.   

    http://www.chinabs.net/js/resolution.asp
      

  2.   

    你这个例子,恐怕得在网站首页放一个隐藏帧,将 screen.width 和 screen.height 发给服务器的 PHP 程序,并记录在 COOKIE 里,以后一直根据页面大小计算 pagesize
      

  3.   

    1.php<head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head><body bgcolor="#FFFFFF" text="#000000">
    <script language="javascript">
    if(window.screen){
    var w=screen.width;
      url_800="2.php?w=800&h=600";
      url_1024="2.php?w=1024&h=768";
    if(w<835){
    self.location.replace(url_800);
    }
    else{
    self.location.replace(url_1024);
    }
    }
    </script>
    </body>
    </html>2.php<html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head><body bgcolor="#FFFFFF" text="#000000">
    <?
    echo $user."<BR>";
    echo $w." X ".$h;
    ?></body>
    </html>
      

  4.   

    不错,我也会了!谢谢 hflsj(hflsj)