You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
var conf = new Array();
conf['key1'] = {text: 'sometext', posx: 50, posy: 50};
conf['key2'] = {text: 'othertext', posx: 50, posy: 80};
var a = $.toJSON(conf);
this code fails
Krinkle
changed the title
if javascript object has sub-Array, then json string is wrong.
If object has sub-Array, then json string is wrong
May 26, 2014
This is not a valid bug for the native JSON.stringify method exhibits the same behaviour and we're just polyfilling that. We can't take feature requests.
Per the ES5 specification, when serialising an Array object:
The representation of arrays includes only the elements between zero and array.length – 1 inclusive. Named properties are excluded from the stringification.
I recommend you do not be add named properties to array objects in your program. You're probably confusing arrays with objects (other programming languages sometimes call them arrays).
Krinkle
changed the title
If object has sub-Array, then json string is wrong
Object properties if an Array are not included in json string
Jul 3, 2014
Krinkle
changed the title
Object properties if an Array are not included in json string
Array named properties are not included in json string
Jul 3, 2014
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
From Huixian.Cui on August 03, 2012 07:43:50
I changed the code:
Original issue: http://code.google.com/p/jquery-json/issues/detail?id=62
The text was updated successfully, but these errors were encountered: