PDA

View Full Version : Stuffing a Javascript Value into a VBScript Variable


admin
06-04-2003, 02:58 PM
Detect the client's screen resolution using javascript and then stuff it into an ASP variable!

<%
Response.Buffer = True
%>

<form name="f1" method="post">
<input type="hidden" name="width">
<input type="hidden" name="height">
<input type="hidden" name="mode">
</form>

<%
if Request.Form("mode") = "" then
%>

<script language="javascript">
document.f1.width.value = window.screen.width;
document.f1.height.value = window.screen.height;
document.f1.mode.value = "whatever";
document.f1.submit();
</script>

<%
End If

Width = Request.Form("width")
Height = Request.Form("height")
%>

By Marc Weiser