[Seaside] How to write jQuery $.ready scripts?

Davorin Rusevljan davorin.rusevljan at gmail.com
Sat Jan 2 11:09:11 UTC 2010


On Sat, Jan 2, 2010 at 11:12 AM, Lukas Renggli <renggli at gmail.com> wrote:
> Don't use the JQuery-ready function in Seaside. This gives
> unpredictable results. As Julian suggested use #addLoadScript:,
> Seaside has its own mechanism to execute scripts. Also check our
> JQuery presentation for additional information:
> <http://www.slideshare.net/esug/jquery-in-seaside>.

ah, this presentation is great! One question though, you say in
presentation that we should forget about unobtrusive javascript. Is it
that you consider it somehow harmfull or just not that important in
Seaside, and why?

as for addLoadScript, it seems to attach itself to body onLoad DOM
event. Am I correct that this will execute only after everything has
been downoloaded, including banners and such? In that case I would
rather use jQUery.ready() since it would provide much quicker and
reliable execution. But if you say it is off limits than I should
forget about it. Is there maybe some cheatsheet that would allow me to
use .ready safely with Seaside?

>> Am I missing something or there is no Seaside binding for
>> jQuery(..).click() function? (I am using Dolphin port of Seaside which
>> is 2.9.something)
>
> There is #onClick: at least in the latest version of JQuery for Seaside.

yes, but that also bounds to DOM onClick, instead of using
jQuery.click which might be argued to be more flexible (allows easy
attachment of several handlers), and to some extent normalizes
incompatibilities in browser event handlings.

Thanks a lot, to both of you!

rush
http://www.cloud208.com/


More information about the seaside mailing list