If I defined an object in JS with:
var j={\"name\":\"binchen\"};
How can I convert the object to JSON? The output string should be:
Simply use JSON.stringify(your_variableName) it will convert your JSON object to string and if you want to convert string to object use JSON.parse(your_variableName)