var str = 'hello';
var json = {};
json[str] = 'wassup';
alert(json.hello);
Ask google about dot and square bracket notations for more info.
On 10 мар, 08:15, "gordiany...@gmail.com"
wrote:
> var str = "hello";
> var json = {
> str: "123"
>
> }
>
> I know this is not jquery question , but I don'
just a wild guess but have you tried this.str?
> Date: Mon, 9 Mar 2009 22:15:27 -0700
> Subject: [jQuery] How can I use VAR str into json object
> From: gordiany...@gmail.com
> To: jquery-en@googlegroups.com
>
>
> var str = "hello";
> var json = {
> str: "123"
> }
>
> I know this is not jquer
2 matches
Mail list logo