I try to convert a javascript object into string, but i just cannot get the solution after Google on it. Can someone help me about it? Thanks first...
mbabuskov
9:46 pm on Apr 10, 2011 (gmt 0)
If it's one of the built-in JS types, you can use toString() method.
If it's the object you build, you need to build the string yourself, by combining stuff returned by toString for each object attribute. Make sure the created string is in JSON notation.
Since, this is a common task, there are ready-made functions and libraries that implement this functionality. For example, google for json.stringify