<div dir="ltr">Thanks Johan, that&#39;s the kind of advice I need, as there are many ways to do things.<br><br>Now, I am stumped (for hours!) on another very similar problem, except instead of a single variable, I simply want to pass an argument of type &quot;jQuery&quot; into jQuery&#39;s replaceWith() function, called within a onClick handler method.  So, in my renderContentOn:, I wrote:<br><br>     | ajaxRequest |<br>     ajaxRequest := (html jQuery post<br>          url: html actionUrl;<br>          dataType: &#39;html&#39;) html: [  : replaceHtml | self invoke.  replaceHtml render: resultWidget ].<br>           ....<br>     html script defer with:<br>          ((html jQuery id: buttonId) onClick:<br>               ((html jQuery id: replacementId) replaceWith: ajaxRequest asJavascript) asFunction).<div><br></div><div>However, as before, the argument to replaceWith() is being rendered as a Javascript string literal instead of the code itself.  (See red quotes, below, I want it to stop rendering those quotes!).</div><div><br></div><div>    $(&quot;#id3&quot;).click(function(){$(&quot;#id4&quot;).replaceWith(<b><font color="#cc0000">&quot;</font></b>$.post(&amp;quot;/puf&amp;quot;,[&amp;quot;_s=C8vA8l5UNoUsGTpf&amp;quot;,&amp;quot;_k=B_Wk6EYdovACqAgV&amp;quot;,&amp;quot;2&amp;quot;].join(&amp;quot;&amp;amp;&amp;quot;),&amp;quot;html&amp;quot;)<font color="#990000"><b>&quot;</b></font>)})<br></div><div><br></div><div>I tried many different variations, no success.  This must be something simple...</div><div><br></div><div>Thank you.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 9, 2015 at 2:25 AM, Johan Brichau <span dir="ltr">&lt;<a href="mailto:johan@inceptive.be" target="_blank">johan@inceptive.be</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Chris,<br>
<br>
I notice you figured out the use of #alias:<br>
<br>
Use the JS generation facilities only when you need to *generate* code. For example, to embed a server-side callback or, in general, when the code can only be dynamically constructed.<br>
In your case, I would do the following:<br>
<br>
(JSStream on: ‘console.log(event)’)<br>
<br>
Just because you can write it in Smalltalk does not mean you should :)<br>
<span class="HOEnZb"><font color="#888888"><br>
Johan<br>
</font></span><br>
ps: your contributions are in my inbox, I will process them asap<br>
<div class="HOEnZb"><div class="h5"><br>
&gt; On 09 Oct 2015, at 03:46, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Found something.  JSAlias.<br>
&gt;<br>
&gt;&gt;    html span<br>
&gt;&gt;         class: &#39;PufMessageWidget&#39; ;<br>
&gt;&gt;         id: (self assureHtmlIdUsing: html) ;<br>
&gt;&gt;         onClick: ((html javascript logger call: &#39;log&#39; with: &#39;event&#39;)<br>
&gt;&gt; asFunction: #(&#39;event&#39;)).<br>
&gt;<br>
&gt; I gave up on onClick: since I guess its better to set up event<br>
&gt; bindings through jQuery&#39;s API.  This binding does what I want, no<br>
&gt; syntax error.<br>
&gt;<br>
&gt;     html script defer with:<br>
&gt;          ((html jQuery id: (self assureHtmlIdUsing: html)) onClick:<br>
&gt;               ((html javascript logger call: &#39;log&#39; with: (html<br>
&gt; javascript alias: &#39;event&#39;)) asFunction: #(&#39;event&#39;))).<br>
&gt;<br>
&gt; It seems like a pretty wordy way to write console.log(event), but the<br>
&gt; intent reads clearly so, that&#39;s good..<br>
</div></div><div class="HOEnZb"><div class="h5">&gt; _______________________________________________<br>
&gt; seaside mailing list<br>
&gt; <a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" rel="noreferrer" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" rel="noreferrer" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br></div>