Is a javascript object accessible in the .rjs file (AJAX)?

Hi All

In my rhtml file I create a javascript object like

This ‘js_obj’ is the javascript object which use all the time in this
page to hide/show/change stuff depending on the users actions. At some
point the user can click a button, which starts an AJAX
request(button_to_function), which will update, lets say, tab 3. This
means: I need to do the AJAX call and afterwards chnage to tab 3. I
hoped that I could access to ‘js_obj’ in my .rjs file so I could do
something like

page.js_obj.showTabByIndex(3)

This should change to tab 3, but doesn’t work. Hopefully I have the
syntax wrong, do I ?

If this is not possible is there a way I can perform an action after the
ajax request is finished with a button_to_function request ?

Thx
LuCa

i may be wrong, but i think i read a couple of times that you can do
this in an rjs file:

page << “js_obj.showTabByIndex(3)”

i think you can “feed” any JavaScript code into the page object like
this, and it wll be sent back to the browser.
could be wrong though, give it a try.

that works perfect, thnx

Just for those interested, I noticed that the same thing can also be
done using

:complte => "js_obj.show......."

inside the button_to_function call (this is on the client side)

LuCa