Lightbox and RJS

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

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 K.
(909)630-9562
[email protected]