Javascript String to_json()
json()
String.prototype.to_json = function () { try {/*from www .ja v a 2s . co m*/ return JSON.parse(this.valueOf()); } catch (ex) { return this.valueOf(); } };