ASP中如何获取客户端屏幕分辨率

作者:chilleen 来源:ITPOW 日期:2006-1-26

ASP中是不能直接获取客户端屏幕分辨率的,有些访问统计软件之所以可以统计客户端屏幕分辨率,是因为它使用了与JavaScript结合的方法。

统计页面(statistic.asp)
<%
dim screenWidth
screenWidth = CInt(request.QueryString("screenWidth"))
……
%>

调用页面(call.js)
document.write("<script src=\"http://……/statistic.asp?screenWidth=" + screen.width + "\"></script>");

要统计的页面加入如下语句
<script type="text/javascript" language="javascript" src="http://……/call.js"></script>

相关文章