views:

19

answers:

1

I can set javascript variables.. but can I retrieve them? if so. how?

+2  A: 

I think what you really asking how you can retrieve client-side state, right? The process of "setting" a variable is actually downloading code into the browser which runs and has that side-effect. To get state back from the browser, be that Javascript variables or DOM element values, requires the opposite, i.e. to upload something.

What you most likely want is do XHR requests within your Javascript back to the server to transmit the required state. Make sense?

bjg
perfect sense. thanks.
DerNalia