Forum: Ruby on Rails Lightbox and RJS

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.
9dbe5b9021bf8477a3b7e747b44bde48?d=identicon&s=25 Sean O'Hara (Guest)
on 2006-05-28 20:02
(Received via mailing list)
Hi,

I am trying to include lightbox functionality in my app, but there is
a slight complication. Apparently lightbox initializes all the links
to lightbox events on page load. However, in my case, some new links
to lightbox events will be rendered to the page through ajax events
(obviously this means after the page loads). So I figure I need to
find a way to call lightbox's initialize() function with every ajax
response. So I am trying to call this function from RJS. Here's my code:
page << 'intialize()'

This gives me the following error (in Firefox):
RJS error:
Reference Error: initialize is not defined.

So I guess it's interpreting as an rjs call rather than simply
javascript. In a previous post I read that the syntax above would
allow one to using custom javascript, but it doesn't seem to be the
case here. Any ideas?

Thanks,
Sean
66436ae6502afa76c02fb18f943c69e8?d=identicon&s=25 Phillip Kast (Guest)
on 2006-05-28 20:18
(Received via mailing list)
Sean O'Hara wrote:
>
> This gives me the following error (in Firefox):
> RJS error:
> Reference Error: initialize is not defined.
Lightbox collects all of it's magic within a Lightbox object, so you
need to say

Lightbox.initialize()

instead.

And hello to the rails list; I'm new here.
phil


--
Phillip Kast
(909)630-9562
phil@unimedia.org
This topic is locked and can not be replied to.