[Seaside] how to render access to a JS argument variable?

Chris Muller ma.chris.m at gmail.com
Thu Oct 8 21:48:43 UTC 2015


Hi all, by using a process of "simplifying until it works" I think I'm
slowly "getting it".  However, now I've arrived at something very
simple which isn't working, and I don't know what I'm doing wrong.

Can someone tell me whats wrong with this Javascript that I'm getting
the message "Uncaught SyntaxError: Unexpected token ("?

   <span class="PufMessageWidget" id="id3"
onclick="function(event){console.log(&quot;event&quot;)}">my
content</span>

Here's the code I'm using to render the above:

    html span
         class: 'PufMessageWidget' ;
         id: (self assureHtmlIdUsing: html) ;
         onClick: ((html javascript logger call: 'log' with: 'event')
asFunction: #('event')).

And, this leads to my second question.  Even if the script above
didn't cause a SyntaxError, I want to log the event *variable* in the
console, not the string "event".

Any help is greatly appreciated..

PS -- Okay, I just noticed if I don't pass the #asFunction:
#('event'), I get 'event' in the console without any SyntaxErrors.
But, clearly, what I'm wanting to do should work should't it?


More information about the seaside mailing list