Bill Moseley wrote:
> Avoiding real work I decided to try and clean up my html and remove my
> inline onclick handlers for Ajax.Updater calls.  Here's the inline
> method I've been using:
> 
>     http://hank.org/demos/ajax-inline.html
> 
> 
> Now, here's using <script> sections to apply the behavior.
> 
>     http://hank.org/demos/ajax.html  (firefox only)
> 
> Since the links (tabs) are inside the <div> that is updated by the
> ajax request I have to find a way to re-apply the event handlers
> to those links after the update.
> 
> I'm currently using evalScripts and the ajax response includes a
> <script> section (see http://hank.org/demos/recent).
> 
> I'm wondering if there's other approaches people are using.  One idea
> would be to save the list of element ids that need the behavior, and
> use onComplete to re-observe those elements.

Look at Behaviour.js. If you use that, then you can just call
Behaviour.apply() to reapply the effects.


-- 
Michael Peters
Developer
Plus Three, LP

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to