js中的json. 一种轻量级数据格式.
json中的值是map形式的就是
key->value. 具体看下边的示例;

var person = { // 用 大括号括声明一个json.
"name":"lz" //key是name, value是lz;
};
//这个时候你可以这样使用它
alert(person.name);
//-----------如果你试了一下代码,到这里你应该明白它是什么格式了..
//------a:function(){} 中 a是key,function() 是 value
var person2 = {
"name":"lz", //有多个 key,value 用,号分开.
"say" : function(){
alert('hello word!');
}
}
person2.say();

/ *
其中 say:function(){alert('hello word!')}; 类似于
var say = function(){
alert('hello word!');
};

*/

相关文章:

  • 2022-12-23
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2020-07-27
  • 2021-11-29
  • 2021-09-08
猜你喜欢
  • 2021-05-21
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
相关资源
相似解决方案