<div dir="ltr"><div><div><div><div><div><div>wqTest come from WQTest class<br></div>class side: <br>canBeRoot <br>    ^ true<br><br></div>initialize<br>    super initialize.<br>    (WAAdmin register: self asApplicationAt: &#39;wqTest&#39;)<br>        addLibrary: JQDevelopmentLibrary;<br>        addLibrary: WQTestFileLibrary<br><br><br></div>instance side:<br></div>renderContentOn: html<br>    html button<br>        onClick: (html jQuery ajax callback: [ :value | Transcript show: &#39;value&#39; ] value: (html javascript call: &#39;test&#39;));<br>        with: &#39;Call test&#39;<br><br></div>And WQTestFileLibrary<br></div><div> contains a single JS file with:<br><br>function test() {<br></div><div>  return true;<br></div><div>}<br><br></div><div>This a very small example just to see where the bug could come from<br><br><br></div><div>Thomas<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-22 21:48 GMT+02:00 Johan Brichau <span dir="ltr">&lt;<a href="mailto:johan@inceptive.be" target="_blank">johan@inceptive.be</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I think you will need to supply a bit more code or information.<div><br><div>Where is wqTest coming from?</div><div><div class="h5"><div><br><div><blockquote type="cite"><div>On 22 Sep 2015, at 19:47, Thomas Heniart &lt;<a href="mailto:heniart.thomas@gmail.com" target="_blank">heniart.thomas@gmail.com</a>&gt; wrote:</div><br><div><div dir="ltr"><div>Error is in wqTest (:1:104), so I don&#39;t think that error is in my JS file which only contains<br></div><div>function test() {<br></div><div>  return true;<br></div><div>}<br><br></div><div>Really strange...<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-22 19:35 GMT+02:00 Johan Brichau <span dir="ltr">&lt;<a href="mailto:johan@inceptive.be" target="_blank">johan@inceptive.be</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">In what file is the syntax error?<div><br></div><div>This is probably a syntax error in your javascript.</div><div><br><div><blockquote type="cite"><div><div><div>On 22 Sep 2015, at 19:21, Thomas Heniart &lt;<a href="mailto:heniart.thomas@gmail.com" target="_blank">heniart.thomas@gmail.com</a>&gt; wrote:</div><br></div></div><div><div><div><div dir="ltr"><div>I get this error when I load the page:<br>SyntaxError: expected expression, got &#39;.&#39;<br></div><div>and I don&#39;t know why :/<br></div><div>What could it be?<br></div><div><br><br></div><div>Cheers,<br></div><div>Thomas<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-22 18:31 GMT+02:00 Thomas Heniart <span dir="ltr">&lt;<a href="mailto:heniart.thomas@gmail.com" target="_blank">heniart.thomas@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>2015-09-22 9:13 GMT+02:00 Johan Brichau <span dir="ltr">&lt;<a href="mailto:johan@inceptive.be" target="_blank">johan@inceptive.be</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thomas,<br>
<br>
You can use the jQuery binding in Seaside to easily return javascript values in ajax callbacks.<br>
For example:<br>
<br>
html<br>
        button;<br>
        onClick: (html jQuery ajax callback: [:value | Transcript show: value ] value: (html javascript call: ‘test’ withArguments: #()))<br>
        with: ‘Call test’<br></blockquote><div><br></div></span><div>I tried this but it doesn&#39;t work, nothing appeared in the Transcript like if the callback isn&#39;t triggered...<br></div><div>Maybe I forget something in the configuration of application<br>(WAAdmin register: self asApplicationAt: &#39;Test&#39;)<br>        addLibrary: JQDevelopmentLibrary;<br></div><div>        addLibraby: MyLibraryWithJsFiles<br><br></div><div>MyLibraryWithJsFiles contains just a js file with test() { return true; }<br></div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The #callback:value: method passes the result of client-side expression to the server-side callback.<br>
Mind that (as the method comment states), this only works for single literal Javascript object (String, Number, Boolean). If you want to pass more complex result values, you can use #callback:json: or write your own serialization if json serialization is not sufficient either.<br>
<br>
Hope this answers your question,<br>
Johan<br></blockquote><div><br><br></div></span><div>Thanks for your help,<br></div><div><br></div><div>Thomas <br></div></div><br></div></div>
</blockquote></div><br></div></div></div><span>
_______________________________________________<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" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br></span></div></blockquote></div><br></div></div><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>
<br></blockquote></div><br></div>
_______________________________________________<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" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br></div></blockquote></div><br></div></div></div></div></div><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>
<br></blockquote></div><br></div>