David - I think the "catch" was the very last item that was mentioned on the page: Grouping all "inline" JS snippets into a single file. That's what makes the plugin all worth it.
--John On 3/2/07, David Duymelinck <[EMAIL PROTECTED]> wrote: > François Zaninotto schreef: > > I'm not sure I get you... All the helpers described in the blog post are > > bundled with the plugin. Or do you mean something else? > > > > > Why would you need to have a function that writes inline javascript code > if the whole idea of the plugin is to generate unobtrusive javascript. > I'm talking about the > > UJS_write function to be exact. > > http://www.symfony-project.com/trac/wiki/sfUJSPlugin#Addingsomecontentunobtrusively > > It is this example that confused me. > > <?php UJS_write('<a href="#" onclick="$(\'#foobar\').toggle();return > false;">click me</a>') ?> > > Isn't it better to write it as > > <?php > UJS_write('<a href="#" class="toggle">click me</a>'); > UJS_add_behaviour('a.toggle', 'click', "$('#foobar').toggle();return false;"); > ?> > > If you go unobtrusive go unobtrusive all the way :) > > Once i get around to learning how to use symfony i will definitively give > your helper a try. I bet this will amaze my more code challenged colleagues :) > > -- > David Duymelinck > ________________ > [EMAIL PROTECTED] > > > _______________________________________________ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/