View Full Version : Java script parameter problem

02-03-2004, 12:16 PM
I am trying to pass a variable contents from a Java script into VBscript environment.

The following code is what I have:

<script language="Javascript" src="http://gd.geobytes.com/gd?after=-1&variables=GeobytesCountry,GeobytesCity">
<script language="Javascript">

As you can see, I cannot access variable strcountry.

Reason been that all client side scripting such as java is executed after the server side.

I want to know how I can pass that variable to VBscript environment using an alternative way.

The java script gets the country and city of the clients pc using a URL.


Roy Sinclair
02-03-2004, 03:55 PM
You need one page that you can serve to the client with the script in it and that page can place the responses into a form (or build a url that passes those responses) and that page can then be posted to the server where you can use those responses to create the next page.

What you cannot do is create part of a page (or even a whole page) on the server and then get data from the client and create the rest of the page (or a second page) as one run of the server side code. Your server side code will be completely finished executing before the client begins to interact with the web page that came from the server.

If you want data to persist from one sending of the page to the next for a user then you need to look into data persistance stategies like Session variables or database stores.

02-03-2004, 04:05 PM
Eventhough I don't think its all that good an idea one can use script tags to communicate to and from a server after the page has loaded.