easiest way of creating a javascript object

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

easiest way of creating a javascript object

NorbertHartl
When I do something like

(jQuery value: '.span3') css: (Dictionary new at: 'margin-bottom' put: '10px'; yourself) asJSON

is there a shortcut or a better way to shorten the creation of an js object? Or another way of doing the whole statement?

thanks,

Norbert
Reply | Threaded
Open this post in threaded view
|

Re: easiest way of creating a javascript object

Nicolas Petton

Amber has literal dictionaries (HashedCollection):

(jQuery value: '.span3') css: #{'margin-bottom'-> '10px'}

Norbert Hartl <[hidden email]> writes:

> When I do something like
>
> (jQuery value: '.span3') css: (Dictionary new at: 'margin-bottom' put: '10px'; yourself) asJSON
>
> is there a shortcut or a better way to shorten the creation of an js object? Or another way of doing the whole statement?
>
> thanks,
>
> Norbert
--
Nicolas Petton
http://nicolas-petton.fr