XML、JSON在线转换

XML、JSON在线转换

转义编码 if (typeof (JKL) == 'undefined') JKL = function () {}; // JKL.Dumper Constructor JKL.Dumper = function () { return this; }; // Dump the data into JSON format JKL.Dumper.prototype.dump = function (data, offset) { if (typeof (offset) == "undefined") offset = ""; var nextoff = offset + " "; switch (typeof (data)) { case "string": return '"' + this.escapeString(data) + '"'; break; case "number": return data; break; case "boolean": return data ? "true" : "false"; break; case "undefined": return "null"; break; case "object": if (data == null) { return "null"; } else if (data.constructor ==