[Seaside] calling a JS function
Boris Popov, DeepCove Labs
boris at deepcovelabs.com
Wed Sep 7 20:18:51 UTC 2011
Milan,
((Dictionary new)
at: 'custom' put: (JSStream on: 'doSomething');
yourself) asJavascript
'{"custom":doSomething}'
HTH,
-Boris
-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of Milan Mimica
Sent: Wednesday, September 07, 2011 4:15 PM
To: Seaside - general discussion
Subject: Re: [Seaside] calling a JS function
I get an error: WAError: Override #jsonOn: to make the receiver serializeable as JSON (JSStream on: 'doSomething') returns a JSStream object who doesn't understand asJson.
On 7 September 2011 21:55, Johan Brichau <johan at inceptive.be> wrote:
> Try this:
>
> (Dictionary newFrom: {'custom' -> (JSStream on: 'doSomething')}) asJson.
>
> I would want to know if there is a better way.
>
> On 07 Sep 2011, at 21:31, Milan Mimica wrote:
>
>> I need to pass s JS function to some jQuery widget. I don't want to
>> inline it, but instead have it separate in a file.
>>
>> The problem is:
>> (Dictionary newFrom: {'custom' -> #doSomething}) asJson.
>> produces:
>> {"custom":"doSomething"}
>> while I need:
>> {"custom":doSomething} (without quotas)
>>
>>
>>
>> --
>> Milan Mimica
>> http://sparklet.sf.net
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
--
Milan Mimica
http://sparklet.sf.net
_______________________________________________
seaside mailing list
seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
More information about the seaside
mailing list