View Full Version : variable availability
charliek
04-30-2003, 08:49 PM
I can't seem to pass the value of a variable from JavaScript to .asp code on the same page. Is that possible? If the question doesn't make sense or the answer is obvious, please tell me that too. I have been doing server side .asp for a year or more but have just discovered a use for JavaScript.
thanks for helping.
charlie k
beetle
04-30-2003, 08:51 PM
Pass it? What do you mean pass it?
You can append data to the query-string so ASP can retrieve it.
charliek
04-30-2003, 09:20 PM
thanks, beetle. by "pass it", i mean use it later in the page. for example, if i open a new page using window.open and pass a value after a "?", I want to be able to use that value later in the asp part of the page. I can retrieve it in JavaScript, but can't use it later in the asp part of the same page.
thanks again.
charlie k
beetle
04-30-2003, 09:24 PM
Oog, you are confusing me....
Let's say we have this URL
somepage.asp?foo=bar
Okay? Now, ASP + vbscript (I assume) will process this page and send HTML to the browser - presumably based on the content of foo. Once it has done that, ASP is done until another page-request is made (that's clicking on a link to you)
Javascript on said page can access the data as well
So, by saying ASP using it "later" as in "after javascript" makes no sense, because that's impossible.
charliek
04-30-2003, 09:53 PM
Beetle
Something you said just jarred me into figuring out the solution. I can merely use the querystring variable in the target page. I had thought that the only way to access those variables passed after the "?" was through JavaScript.
thank you so much. because of your explanation, i understand a little more about what is available when as well.
charlie k
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.