Get back a Javascript variable


Do this by making this call in the section of your .rhtml page.
<%= javascript_include_tag “Name Of Javascript” %>

I thik this will resolve your problem.


You have to send it back somehow. A hidden field in a form, a parameter in the URL, Ajax, ....

You'll typically write JavaScript code to hook into the new request to add the value of the variable when the request starts. For instance, if there's a form some code in onsubmit sets the hidden field to the value of the variable at that moment. You see the idea.

-- fxn