Cannot Get JSON for the JavaScript Object -


this question has answer here:

i'm creating js object

var eledetailstop = new array();  var j = 0; var id = "ele"+j; eledetailstop[id] = {id: id, size : "40%", sizelabel : 12, type : "image", title : "image"}; 

now, i'm trying convert object json...

var fields = json.stringify(eledetailstop); 

so, problem is, gives empty result.

here got when debugged firebug

enter image description here

as can see there object called wrappedjsobject inside this. if checked inside it, can see wrappedjsobject on...

why ? why weird ?

you're creating array , assigning alphanumeric property. try this:

var j = 0; var id = "ele"+j; eledetailstop[j] = {id: id, size : "40%", sizelabel : 12, type : "image", title : "image"}; 

edit: if want use id property - defined eledetailstop object:

var eledetailstop = {}; 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -