Or, you could add to the onComplete handler on the Ajax.Updater

new Ajax.Updater(container, url, {
  onComplete: function(t) { $("link").observe("click", handler); }
});

This will keep the javascript in one place, and will be called only
after the content has been pulled into the page.

Get to know all the callbacks and options you can pass to the
Ajax.Request and Ajax.Updater objects:
http://prototypejs.org/api/ajax/options

Best,
-Nicolas

On Feb 10, 2008 4:12 AM, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
> On Feb 10, 2008 12:55 AM, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
>
> >
> > Yup. That makes sense. So what you want to do is not call
> > Event.observe on page load but, after the Ajax call has been completed
> > and the html inserted.
> >
> > You may not be able to use the updater method, since you need to
> > coordinate the call.
> >
> > Instead, use Ajax.Request and manually update the subnav with the $
> > ('container').update(html) method. After that, THEN call
> > Event.Observe.
>
> using Ajax.Updater together w/ the evalScripts option will do just that,
>  and it will be simpler to implement.
>
> -nathan
>
>
>
>  >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to