[Seaside-dev] How to ensure a script appears only once on page?

Lukas Renggli renggli at gmail.com
Wed Mar 19 07:43:43 UTC 2008


>  Now, there might be a work-around for the YUI calendar situation, but
>  I have a more general question: Is there some way to hook in to the
>  beginning or end of a render process? I've come up with a crude
>  approach where each component notifies the session at the beginning
>  and end of a render and the session keeps track of the first in and
>  then lets it know when it is the last out. Are there any other good
>  ideas?

     self session addLoadScript: ...

Adds a small snippet that will be evaluated when the page has loaded.
If you want you can also query

    self session onLoadScripts

what scripts already have been added. However this scenario looks more
like you should rather use a static script from a file-library.

Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the seaside-dev mailing list