Re: executing javascript and vbscript



gmail wrote:

The problem I'm having is I have to reload the page twice (click the
button twice) before changed values are used. It seems like the
vbscript is executed before the javascript has finished, meaning the
request.cookies("WhereValue") is executed before the cookie value is set
by javascript, so the request pulls the old value. Is something like
this happening? What am I doing wrong here?

Communication between the server and the client happens in one direction at
a time.

First the client makes a request, which includes any cookies that are set,
then the server makes a response (and your ASP is executed on the server),
then the response is received by the client and client side code is
executed.

So the cookie is set using your client side JavaScript AFTER all the cookies
have been sent to the server and AFTER all the server side ASP has been
executed.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
.



Relevant Pages