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

Julian Fitzell jfitzell at gmail.com
Sat Jan 2 08:52:01 UTC 2010

Hi Davorin,

Try #addLoadScript: - look for senders if you need examples.



On Fri, Jan 1, 2010 at 2:31 PM, Davorin Rusevljan
<davorin.rusevljan at gmail.com> wrote:
> I guess I am a bit dense right now, so forgive me if I am askig obvious.
> So, I would like to have few jQuery operations executed when DOM is
> ready. My best so far is:
> renderContentOn: html
>        html script: (html jQuery
>                                ready: ( (html jQuery: #glavati)
>                                                text: 'Njurko';
>                                                on: 'click' do: 'alert("gotcha");' )).
>        html script: (html  jQuery
>                        ready: 'alert("aha");' ).
>        html heading
>                level: 1;
>                id: #glavati;
>                with: 'Gurko'.
> Which does get job done, but in generated html it opens javascript tag
> twice which is kind of ugly (especially if I would have more
> operations in the future). So how would I structure code above so that
> generated code has just one script tag? Or even better, has one script
> tag, and also just one $.ready with 2 statements in it?
> Or I am doing it backwards and should put all that code in plain
> javascript file and just include it as is?
> 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)
> Many thanks!
> rush
> http://www.cloud208.com/
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

More information about the seaside mailing list