Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
ASP & Javascript Help
Old 11-08-2004, 08:16 PM ASP & Javascript Help
Junior Talker

Posts: 1
Trades: 0
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!
lmod is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to ASP & Javascript Help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.07893 seconds with 12 queries