function toJSONString(o) { var r = []; if(typeof o ==”string”) return “\””+o.replace(/([\'\"\\])/g,”\\$1″).replace(/(\n)/g,”\\n”).replace(/(\r)/g,”\\r”).replace(/(\t)/g,”\\t”)+”\””; if(typeof o ==”undefined”) return “undefined”; if(typeof o == “object”){ if(o===null) return “null”; else if(!o.push){ for(var i in o) r.push(“\””+i+”\””+”:”+toJSONString(o[i])) r=”{“+r.join()+”}” }else{ for(var i =0;i<o.length;i++) r.push(toJSONString(o[i])) r=”["+r.join()+"]“ } return r; } return o.toString(); } function toJSONString(o) { var r = [];    if(typeof o ==”string”) ...Read More