Duplicate: http://stackoverflow.com/questions/2891476/converting-html-tag-object-to-json-object
Hi, Is there is any Javascript API that converts complex Javascript Objects To JSON String???
up vote
2
down vote
favorite
1
|
Hi, Is there is any Javascript API that converts complex Javascript Objects To JSON String???
|
|||
show 3 more comments |
up vote
1
down vote
|
I don't think what you're looking for a an What you want is called a serializer. It turns a javascript object into a string of text representing the object-literal. For example:
That way when a service receives this JSON information, if it uses javascript, it's already in a format where it can be read directly into memory without conversion. Here is an example javascript serializer: http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx |
||
|
http://www.json.org/json2.js
) serializes nested objects, arrays, numbers, strings, bools, and null. Do you need more? – Joey Adams May 24 at 3:50