Hi all,
Please have a look at following code samples
<%
var sample = {'value':*9*};
var str = stringify(sample);
var parsed = parse(str);
print(parsed);
%>
output : {"value" : {}}
...................
<%
var sample = {'value':*9*};
var str = stringify(sample);
var parsed = JSON.parse(str);
print(parsed);
%>
output : {"value" : *9*}
(You can check it in "Try it" window in http://jaggeryjs.org/)
It seems like for parsing a string with a number inside it as a value, only
JSON.parse works. But in the documentation [1] it is mentioned to use
parse() method. We had this issue several times in our project so now we
are using JSON.parse(). What is the problem with parse()? Is it a bug?
[1] http://jaggeryjs.org/apidocs/parse.jag
Thanks
Dimuthu
--
Dimuthu Upeksha
Engineering Intern
WSO2 inc.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev