javascript - eval json data get different length in IE and firefox -



javascript - eval json data get different length in IE and firefox -

i got json info server ajax:

request.responsetext=[{name:xxx},{name:xxx},{name:xx}].

then utilize

var data=eval(request.responsetext); alert(data.length);

in ie,it "4",while in firefox "3".

use ie debugger found element in info like:

[methods] [0] [1] [2]

so itis length 4.

i wonder why?

my guess server returned info trailing comma, example:

[1, 2, 3, ]

in ie, array interpreted having length 4, while in standard compliant browsers, have length 3.

javascript json

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -