标签:
//json格式的类
var j = ‘obj = { Server:"192.168.2.160",Port:"10000",Url: function (){return this.Server + ":" + this.Port;}} ‘;
var jc = eval(j); //转换为对象
jc.Port = "111";
alert(jc.Url());
//定义的其他格式类也一样可以 eval(string)转换
标签:
原文地址:http://www.cnblogs.com/trueblue/p/5497572.html