[Seaside] Problem with JSScript vs JSObject
Mariano Martinez Peck
marianopeck at gmail.com
Fri Jan 13 21:58:26 UTC 2017
Hi guys,
Maybe it is because it's already Friday afternoon but I am failing to see
something obvious probably.
I render a div this way:
html div
id: self chartId;
class: 'researchChartComponentChartContainer';
script: (chart wholeScriptOn: html).
And the method #wholeScriptOn: does:
wholeScriptOn: html | script chart | script := JSScript new. chart := self
makeChartOn: html. script << chart. ^ script
The method #makeChartOn: answers an instance of Highstock (subclass of
JSObject).
If I let the code as above, I get a client side error:
VM4229:1 Uncaught SyntaxError: Unexpected token $ in JSON at position 0
However...if I change wholeScriptOn: to be:
wholeScriptOn: html ^ self makeChartOn: html
It works.
So...what the hell is going on? As an instance of Highstock it works but as
a JSScript it doesn't?
They even seem to print the same #asJavascript.
Any idea?
Thanks in advance,
--
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20170113/0f35554b/attachment.html>
More information about the seaside
mailing list