<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
I'm no Scriptaculous (however you spell that) user, but here's an example utilizing jQuery:<br><br>html image<br> id: 'macd';<br> src: 'http://www.seaside.st/styles/logo-plain.png'.<br> <br> html break.<br><br> html anchor<br> onClick: (html jQuery ajax script: [:script | script add: (<br> <br> (script jQuery: #macd) attributeAt: 'src' put: 'http://www.lukas-renggli.ch/files/4d/y6mlhntkxm44gwm09o7ufxh7tlij4u/diff.png'<br> <br> )<br> ]);<br> with: 'Replace it'.<br><br>Here's some pointers:<br><br>a) The image path you have is invalid.<br>b) The 'url' attribute is actually 'src', and will be rendered that way (check your page source with Firebug or something).<br>c) You cannot create an object ie. "(html image id: 'macd'; url: 'http://etrade.com/IBM.macd.gif')" and render it this way.<br>d) I called an ajax script, which isn't necessary unless you want to use a variable for changing the image. The following works fine for a static url:<br><br>"onClick: ((html jQuery: #macd) attributeAt: 'src' put: 'http://www.lukas-renggli.ch/files/4d/y6mlhntkxm44gwm09o7ufxh7tlij4u/diff.png');"<br><br>I hope this helps, someone else please elaborate on this... I'm certainly no expert :)<br><br>RS<br><br>Thanks for the random image Lukas :p<br><br>> To: seaside@lists.squeakfoundation.org<br>> From: squeakman@gmail.com<br>> Date: Tue, 29 Sep 2009 17:57:40 -0400<br>> Subject: [Seaside] replacing DOM elements using AJAX (Scriptaculous)<br>> <br>> Greetings,<br>> <br>> I am attempting to replace one gif file with another using AJAX. When I <br>> click on the label 'Replace it' what I want is to replace the original <br>> gif with a new gif.<br>> <br>> I suspect that I am using SUElement>>replace: incorrectly.<br>> <br>> Can you tell me what I am doing wrong? I appreciate any help.<br>> <br>> Thanks,<br>> Frank<br>> <br>> --------- code snippet follows ------<br>> <br>> renderContentOn: html<br>> <br>>         "original gif file - for WSM"<br>>         html image id: 'macd';<br>>         url: 'http://etrade.com/WSM.macd.gif'.<br>>                 <br>>         html break.<br>>         html anchor<br>>                 onClick: (html evaluator<br>>                  callback: [:script |<br>>                  script element id: 'macd';<br>>                                                 <br>>                  "the replacement gif - for IBM"<br>>                  replace: (html image id: 'macd';<br>>                  url: 'http://etrade.com/IBM.macd.gif')]);<br>>                 with: 'Replace it'<br>> <br>> <br>> _______________________________________________<br>> seaside mailing list<br>> seaside@lists.squeakfoundation.org<br>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br>                                            <br /><hr />Bing™ brings you maps, menus, and reviews organized in one place. <a href='http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TEXT_MLOGEN_Core_tagline_local_1x1' target='_new'>Try it now.</a></body>
</html>