js 操作json数据
2010-08-05 15:30
344 查看
今天的收获了以下知识,在这里在感谢【人生如梦】
<script type="text/javascript">
function showJSON() {
var user =
{
"username":"liang",
"age":20,
"info": { "tel": "tel", "phone": "phone"},
"address": [{"city":"city","postcode":"postcode"} ]
}
alert(user.username);
alert(user.age);
alert(user.info.tel);
alert(user.address[0].city);
alert(user.address[0].postcode);
}
</script>
<script type="text/javascript">
function showJSON() {
var user =
{
"username":"liang",
"age":20,
"info": { "tel": "tel", "phone": "phone"},
"address": [{"city":"city","postcode":"postcode"} ]
}
alert(user.username);
alert(user.age);
alert(user.info.tel);
alert(user.address[0].city);
alert(user.address[0].postcode);
}
</script>
相关文章推荐
- js跨域操作json数据
- JSON数据格式和js操作json总结
- 前台js传入json或map类型数据给后台以及后台java接收操作
- JS操作JSON数据交换
- json数据在js中的常见操作
- JSON格式数据的js操作
- js操作cookie,将字符串数据解析为json格式
- js之操作JSON数据
- 在JS中操作json数据
- js操作Json数据,JSON对象与字符串转化
- 在JS中操作JSON数据
- js与jQuery实现获取table中的数据并拼成json字符串操作示例
- js操作json添加元素和数据的方法
- JS操作Json数据
- 在JS中操作json数据
- js中如何操作json数据
- Javascript中JSON数据分组优化实践及JS操作JSON总结
- Js操作后台返回的json数据
- js操作json数据
- js操作Json数据,JSON对象与字符串转化 - jack_Meng - 博客园