JQ JSON数据类型
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <script type="text/javascript"> //JSON类型数据 //定义:花括号括起来,key和value成对存在,可以存储任何类型数据 var js={ "one":"111", "two":"222", "three":new Array(1,2,3), "four":{a:1,b:2,c:3} }; //循环JSON数据 for(var k in js) { alert(js[k]); } </script> </body> </html>