标签:style io ar for sp div on cti bs
//json 数组对象
var productArr = [
{"pName":"笔记本","price":"4800","address":"广东富山"},
{"pName":"鼠标","price":"50","address":"北京"},
{"pName":"空调","price":"1300","address":"格力"}
];
//添加对象
productArr.push({"pName":"sssssss","price":"1300","address":"格力"});
var str1 = { "name" : "apple" , "sex" : "21" }; // 参数:prop = 属性,val = 值 function createJson(prop, val) { // 如果 val 被忽略 if ( typeof val === "undefined" ) { // 删除属性 delete str1[prop]; } else { // 添加 或 修改 str1[prop] = val; } } |
标签:style io ar for sp div on cti bs
原文地址:http://www.cnblogs.com/sanhuan/p/4052940.html