[Seaside] how call onLoad() script
karsten at heeg.de
Thu Jul 4 14:39:33 UTC 2013
as you're using jQuery, you shouldn't need to use onLoad(). Instead use the jQuery function like so:
// on load code here
The function that's passed as parameter to jQuery() is executed when the page is ready (like onLoad) or when you load more html, then it's executed when that html is ready.
In Seaside you can use the html-document's #addLoadScript: method, which will call the jQuery function as long as you use the JQScriptGenerator. See WAWelcome class>>initialize on how to tell your application to use that script generator.
To add a load script, do something like:
html document addLoadScript: (…)
html div script: (..).
The later can be a bit tricky though as it overrides the script's ID.
Karsten Kusche - Dipl. Inf. (FH) - karsten at heeg.de
Georg Heeg eK - Köthen
Handelsregister: Amtsgericht Dortmund A 12812
Am Donnerstag, 4. Juli 2013 um 16:00 schrieb Sabine Knöfel:
> I use JQUILayout.
> (In my app, on the left is a menu, in the center different pages depending
> on the menu selection).
> For opening a certain page in the center, after clicking in the menu, I make
> something like:
> html << (html jQuery: #center) html: theView.
> This opens and renders the page -> ok.
> But it does not perform the onLoad() script of theView.
> If I force the same page to reload, the onLoad() (Stg+F5), then fires.
> I think I should send something to theView and need a hint for this.
> View this message in context: http://forum.world.st/how-call-onLoad-script-tp4697350.html
> Sent from the Seaside General mailing list archive at Nabble.com (http://Nabble.com).
> seaside mailing list
> seaside at lists.squeakfoundation.org (mailto:seaside at lists.squeakfoundation.org)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside