现在的位置: 首页 > 综合 > 正文

json 数据格式 javascript 复杂对象

2011年09月18日 ⁄ 综合 ⁄ 共 326字 ⁄ 字号 评论关闭
var oCar = {


"color": "red",

"doors" : 4,

"paidFor" : true

};

复杂数据格式:
var company = {
name:
"Microsoft",
product:
"softwares",
chairman: {name:
"Bill Gates", age: 53, Married: true},
employees: [{name:
"Angel", age: 26, Married: false},
{name:
"Hanson", age: 32, Marred: true}],
readme:
function() {document.write(this.name + " product " + this.product);}
};
alert(company.name);

抱歉!评论已关闭.