var articleTypes = {
'Java' : // 名称
{
id : 'Java',// id
style : 'cursor:hand;',// 样式,
src : 'images/top_02.gif',// 图片
activeSrc : 'images/top2_02.gif',// 被激活时的图片
width : 98,
height : 35
},
'Java web' : {
id : 'Java web',
style : 'cursor:hand;',
src : 'images/top_03.gif',
activeSrc : 'images/top2_03.gif',
width : 98,
height : 35
},
'C#' : {
id : 'C#',
style : 'cursor:hand;',
src : 'images/top_04.gif',
activeSrc : 'images/top2_04.gif',
width : 65,
height : 35
},
'ASP.NET' : {
id : 'ASP.NET',
style : 'cursor:hand;',
src : 'images/top_05.gif',
activeSrc : 'images/top2_05.gif',
width : 98,
height : 35
},
'Visual Basic' : {
id : 'Visual Basic',
style : 'cursor:hand;',
src : 'images/top_06.gif',
activeSrc : 'images/top2_06.gif',
width : 113,
height : 35
},
'Visual C++' : {
id : 'Visual C++',
style : 'cursor:hand;',
src : 'images/top_07.gif',
activeSrc : 'images/top2_07.gif',
width : 113,
height : 35
},
'PHP' : {
id : 'PHP',
style : 'cursor:hand;',
src : 'images/top_08.gif',
activeSrc : 'images/top2_08.gif',
width : 65,
height : 35
},
'ASP' : {
id : 'ASP',
style : 'cursor:hand;',
src : 'images/top_09.gif',
activeSrc : 'images/top2_09.gif',
width : 65,
height : 35
}
};请教这个js源代码是什么意思,没看明白。是数组还是对像,创建的。
应该怎么理解呢?

解决方案 »

  1.   

    这是一个json对象,用来传递数据的。
      

  2.   

    这个是个json对象,这个代码可以理解为两重的map,用于存放数据,一般用于ajax。
      

  3.   

    我也纳闷,很多js的书竟然不介绍json创建对象的方式。json创建空对象 {}
      

  4.   

    这是js中的对象,js也是面向对象的语言,在js中创建对象的基本方式就是var obj = {};或者用var obj = new Object();对象有属性,也就是对象中的属性是键/值对的形式,一个属性的值可以是另外一个对象。