Duplicate: Converting HTML TAG Object to JSON Object
Hi,
Is there is any Javascript API that converts complex Javascript Objects To JSON String???
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think what you’re looking for a an
APIper se. That would be a something like a service where you send data and receive back something else.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