在phonegap的开发中,有时需要知道对象的所有属性,就简单的写了个序列化的方法。序列化方法如下: 1 function serialize(obj, name) { 2 var result = ""; 3 function serializeInternal(o, path) { 4 for (p in o) { 5 var value = o[p]; 6 if (typeof value != "object") { 7 result += "\n" + path + "."... Read More
posted @ 2013-07-24 19:07 Leo C.W Views(1203) Comments(1) Diggs(0) Edit