I found the way to get the width of the client's screen using JavaScript screen.availWidth. But when I put the following code in my page
<head>
<title>My Page</title>
<SCRIPT language="JavaScript1.2">
<!--
<% Dim backgroundFile %>
function loadBackgroundFile() {
var sw = screen.availWidth;
if (sw <= 800) {
<% backgroundFile = "../images/background1.jpg" %>;
}
else {
<% backgroundFile = "../images/background2.jpg" %>;
}
}
//-->
</SCRIPT>
</head>
<body bgcolor="#808080" bottommargin="3" leftmargin="3" rightmargin="3" topmargin="3" onload="loadBackgroundFile();">
it always shows background2.jpg even when the width is changed to 1024. Does someone give a help? Thanks.