JavaScript的function名字不要与字段的ID号同名,否则浏览器可能不识别:

 <script type="text/javascript"  >
var objectA = {
name: "wanglee",
age: 28,
school:
{
college:"大学",
"high school":"闽清一中"
},
like:["运动","看书","交际"]
}

function test() {
alert(objectA.school["high school"]);
alert(objectA.like[2]);
}

function cc() {
alert(objectA.school["high school"]);
}
</script>

 

<input type="button"  />

 

onclick事件将无法触发,IE6下报:对象不支持此属性或方法。 Chrome下无反应

 

环境:VisualStudio2010  Windows2003 IE6

相关文章:

  • 2021-06-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-03
  • 2021-06-21
  • 2021-05-27
  • 2021-12-15
  • 2022-02-18
  • 2022-12-23
相关资源
相似解决方案