|
Hi I am trying to write a script that will collect the users browser window size, color bit rate etc. and submit the for on a condition based on a ASP variables value. I am very new to JavaSctipt and in need of assistance. Here is the basic code:
<%
Dim varRun
If Request.Form("seq")<> "" Then
varRun = "2"
Else
varRun = "3"
End If
%>
<%
If (varRun) = "3" Then
r= (curPage)
%>
<script language="javascript"><!--
var jsRun=<%=varRun%>;
function SetVar()
{
var colors = screen.colorDepth;
var width = window.screen.width;
var height = window.screen.height;
document.f1.resW.value = width;
document.f1.resH.value = height;
document.f1.colorDepth.value = colors;
}
If (jsRun== 3){
document.f1.submit();
}
//--></script>
<form name="f1" method="post" action="<%=r%>">
<input type="hidden" name="resW">
<input type="hidden" name="resH">
<input type="hidden" name="colorDepth">
<input type="hidden" name="seq" value="1">
</form>
<%
End If
The reason for the ASP condition is that I dont want the JavaScript to run everytime a page loads only if varRun = 3. This script works without the condition but I need it to work this way. Please Help!
|