Calling a javascript function after loading a partial with r

Hi,
Is is possible to call a javascript function once a partial is loaded.
Here’s what I am doing.
I have a partial that gets updated via. an ajax call. When the partial
is updated I want to call a javascript function ( enableTooltips ) which
will then add tooltips to my links in the newly updated partial.
Any help would be greatly appreciated.
Thanks,
Eric


Eric G.
ericgoodwin.com

I believe the :complete option will accomplish this for you.

Another method is to stick a script tag in your partial that calls the
function.

Haven’t used either of these, just recalling from the API docs I read so
take it as a starting point for your research.

Bob S.
http://www.railtie.net/

Thanks for the help Bob,

Putting the code in the partial works fine in Firefox, but alas IE lets
up down on this one. It seems that IE doesn’t allow changing HTML tables
via DOM until they are fully rendered. IE crashes with an “Operation
Aborted” error. This happens in both IE 6 and the new IE 7 Beta.

The :complete worked perfectly though. I should have known. It’s getting
late though and my brain isn’t working like it should be.

Thanks again,
Eric

Bob S. wrote:

Hi,
Eric G.
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Eric G.
ericgoodwin.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs