Been on this one for hours. When parsing a JSON response string from an ajax call, the 'true/false' values are put into an array as a string (not boolean). The json string does not have boolean values enclosed in quotes. Also, return header is application/x-json.
I've tried prototype, crockford, byteson and plain straight eval(responseText) but a boolean value returned has a string type. Is there any way to make a boolean value have a boolean type in JS?
Been on this one for hours. When parsing a JSON response string from an ajax call, the 'true/false' values are put into an array as a string (not boolean). The json string does not have boolean values enclosed in quotes. Also, return header is application/x-json.
I've tried prototype, crockford, byteson and plain straight eval(responseText) but a boolean value returned has a string type. Is there any way to make a boolean value have a boolean type in JS?
Thanks!
Are you saying that you have an array of strings in which each element contains either 'true' or 'false', and you want them all converted to booleans? If so, I think this should do it:
Bookmarks