Problem with JSScript vs JSObject
Mariano Martinez Peck <[email protected]>
| Newsgroups | gmane.comp.lang.smalltalk.squeak.seaside |
|---|---|
| Message-ID | <CAA+-=mUjv6hTCj20pzJ7aaL1hGZbTXs3F239_aCE6+teGSBLig@mail.gmail.com> |
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 _______________________________________________ seaside mailing list [email protected] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside