[Seaside] [BUG?] $().replace() consumes loadScripts
Udo.Schneider at homeaddress.de
Sun Dec 28 17:24:02 UTC 2008
I'm not quite sure whether this is a bug or not ...
Seaside2.8a1-lr.572 and Scriptaculous-lr.242 with Damien's
Use the following render method:
self session addLoadScript: 'alert(''You should see this when the page
html span id: 'replaceMe';
with: 'Replace me!'.
html anchor onClick: (html element id: 'replaceMe';
with: 'Replace it'
When loaded one would expect the span and anchor to be shown (which is
the case). In addition one would expect an alert once the page is loaded
(which is not the case).
By inspecting the onclick property of the anchor one can see that it
consits of the text "Replaced!!" plus the loadscripts (including
surounding script tags)!!! The loadScript section at the end of the
document is empty.
So it seems that the loadscripts are appended to the replace expression
- I have no idea why. Clicking on the anchor changes the text and
executes the load scripts ... quite "funny".
If you comment out the #addLoadScript part or the #replace: statement
the remaining part works as expected.
I'm not quite sure what to get out of this ...
(... a bit confused)
More information about the seaside