[Seaside] replacing DOM elements using AJAX (Scriptaculous)

Squeaker squeakman at gmail.com
Tue Sep 29 21:57:40 UTC 2009


I am attempting to replace one gif file with another using AJAX.  When I 
click on the label 'Replace it' what I want is to replace the original 
gif with a new gif.

I suspect that I am using SUElement>>replace: incorrectly.

Can you tell me what I am doing wrong?  I appreciate any help.


--------- code snippet follows ------

renderContentOn: html

	"original gif file - for WSM"
	html image id: 'macd';
	url: 'http://etrade.com/WSM.macd.gif'.
	html break.
	html anchor
		onClick: (html evaluator
		    callback: [:script |
		    script element id: 'macd';
		    "the replacement gif - for IBM"
		    replace: (html image id: 'macd';
		    url: 'http://etrade.com/IBM.macd.gif')]);
		with: 'Replace it'

More information about the seaside mailing list