<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The script you pass on to onClick has many strange things. It seems you are trying to render a script as an ajax response.&nbsp;<div>Seaside (and jQuery) have exactly what you need. Here's what you are probably trying to do:</div><div><br></div><div>onClick: ((html jQuery ajax script:[:s | s &lt;&lt; ((s jQuery id: #bob002) replaceWith: [:h | h div with: Time now asString])]);</div><div><br></div><div>The above will attach a handler script to the onClick event, that loads and executes a script that replaces the second div with a new div.</div><div>However, you probably only want the internals of the div to be replaced. This script does exactly that:</div><div><div><br></div><div>onClick: ((html jQuery id: #bob002) load html: [:h | h render: Time now asString]);</div><div><br></div><div>The above will attach a handler script&nbsp;to the onClick event,&nbsp;that does an ajax html load to replace the contents of the second div with the time at which the click happened.</div><div><div><br><div><div><div>On 18 Sep 2010, at 15:19, Bob Arning wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div bgcolor="#ffffff" text="#000000">
    <font face="Georgia">Hi,<br>
      <br>
      I'm trying to figure out how to use #replaceWith:. After many
      permutations, still no-go. :-(<br>
      <br>
      I want to render 2 divs. When the first is clicked, I want to
      replace the second with something else. Any suggestions?<br>
      <br>
      renderContentOn: html<br>
      <br>
      &nbsp;&nbsp;&nbsp; html div<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; style: 'height: 44px; width: 65px; background-color:
      red;';<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; id: 'bob001';<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; onClick: (html jQuery ajax html: [ :h |<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; h render: ((h jQuery id: #bob002) replaceWith: Time
      now asString).<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ]);<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; with: [html text: 'bob001'].<br>
      &nbsp;&nbsp;&nbsp; html div<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; style: 'height: 44px; width: 65px; background-color:
      green;';<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; id: 'bob002';<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; with: [html text: 'bob002'].<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
      TIA,<br>
      Bob<br>
    </font>
  </div>

_______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br></blockquote></div><br></div></div></div></div></body></html>