在ASP中如何获取浏览器的分辨率值或者说显示器的分辨率值

来源:百度知道 编辑:UC知道 时间:2024/06/09 00:55:35

你可以写一个隐藏的form,与一个隐藏的iframe,在网页被打开的时候,用JS等脚本语言自动提交,
<body onload="document.form1.submit()">
<form name=form1 action=aa.asp target=meizz>
<input name=w type=hidden><input type=hidden name=h></form>
<iframe width=0 height=0 frameborder=0 name=meizz></iframe>
<script language=javascript>
document.form1.w.value=screen.width;
document.form1.h.value=screen.height;
</script>

或者说:

[html]<script language="JavaScript1.2">
<!--
var correctwidth=800
var correctheight=600
if (screen.width!=correctwidth||screen.height!=correctheight)
document.write("<font color=red font-size=9pt><b>提示</b></font><br><font color=blue ><br>本站最佳分辨率:<font color=red > "+correctwidth+"*"+correctheight+".</font>