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:
If you're using AngularJS, the 'json' filter should do it:
{{someObject | json}}