Forum: Ruby on Rails Calling a javascript function after loading a partial with r

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eric G. (Guest)
on 2006-02-03 08:12
(Received via mailing list)
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
Bob S. (Guest)
on 2006-02-03 08:18
(Received via mailing list)
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/
Eric G. (Guest)
on 2006-02-03 08:30
(Received via mailing list)
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
>removed_email_address@domain.invalid
>http://lists.rubyonrails.org/mailman/listinfo/rails
>
>


--
Eric G.
ericgoodwin.com
This topic is locked and can not be replied to.