[Seaside] [BUG?] $().replace() consumes loadScripts

Udo Schneider Udo.Schneider at homeaddress.de
Sun Dec 28 17:24:02 UTC 2008


All,

I'm not quite sure whether this is a bug or not ...

Seaside2.8a1-lr.572 and Scriptaculous-lr.242 with Damien's 
sq3.10.2-7179web08.12.1 image:

Use the following render method:
renderContentOn: html
	self session addLoadScript: 'alert(''You should see this when the page 
has loaded!'');'.
	html span id: 'replaceMe';
		 with: 'Replace me!'.
	html break.
	html anchor onClick: (html element id: 'replaceMe';
			 replace: 'Replaced!!');
		 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 ...

CU,

Udo
(... a bit confused)



More information about the seaside mailing list