日期:2014-05-16 浏览次数:20443 次
var json='{ "message":[{"cndn.net":"unavailable"},{"cndn.com":"unavailable"},{"cndn.biz":"available"}]}';
eval('var o='+json);
o=o.message;
for(var i=0;i<o.length;i++){
for(k in o[i]) alert(k)
}
<!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">
var json='{"message":[{"cndn.net":"unavailable"},{"cndn.com":"unavailable"},{"cndn.biz":"available"}]}';
var o=JSON.parse(json);
for(i in o.message){
for(k in o.message[i]){
alert(k)
}
}
</script>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery.extend demo</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>