<div dir="ltr">Wow, all I need to do is work up an email question, and it seems to lead myself to a solution!   :-)   In this case, I can&#39;t use JQueryInstance&gt;&gt;#replaceWith: only lets the user pass a String argument, not a jQuery argument.  Because the version of JSObject&gt;&gt;#render: always returns a String no matter what, which will never let a JSObject subclass render its code onto the stream.  Strange!<div><br></div><div><div>And, so, the solution was to #call: &#39;replaceWith&#39; with: myJQPost myself.  Here is the code, for comparison to the original:</div><div><br></div><div>     html script defer with:<br>          ((html jQuery id: buttonId) onClick:<br>               (<font color="#38761d">(html jQuery id: replacementId) call: &#39;replaceWith&#39; with: ajaxRequest) </font>asFunction).<br></div><div><br><div>I think this is slowing my learning of Seaside -- the thought that I should be able to use all the convenience methods and get all the power of JQuery, but, in fact, some of these methods provide no way to render the other versions of the jQuery calls which take different argument types.  Only the string types are supported.  Am I right about this?<br></div><div><br></div><div>Another example is the &quot;data&quot; argument of a $.ajax(...) request.  Seaside renders a Javascript array, but then calls .join(&quot;&amp;&quot;) on it!  Strings only....  :(</div><div><br></div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 9, 2015 at 4:52 PM, Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><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=""><div class="h5"><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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style: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><font color="#888888"><br>
Johan<br>
</font></span><br>
ps: your contributions are in my inbox, I will process them asap<br>
<div><div><br>
&gt; On 09 Oct 2015, at 03:46, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com" target="_blank">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><div>&gt; _______________________________________________<br>
&gt; seaside mailing list<br>
&gt; <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">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" target="_blank">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>
</div></div></blockquote></div><br></div></div></div></div></div>