jquery中$.getJSON()
来源:互联网 发布:linux重启后ping不通 编辑:程序博客网 时间:2024/04/29 10:47
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title></title></head><body><script type="text/javascript" src="js/jquery-1.11.3.min.js"></script><script> function show() { $.getJSON ( "json.php", function (data) { alert(data.name); //console.log(data); }); }</script><input type="button" onclick="show()"></body></html>
json.php:
<?php $arr=array("name"=>"zhangsan", "age"=>20); $jarr=json_encode($arr); exit($jarr);?>
console.log()可以用于js数组和对象的查看,在浏览器的控制台会打印相关的数据
function(data)中data的值就是php中$jarr值,格式如下
{name:"zhangsan",age:20}
0 0
- jquery中$.getJSON()
- javascript外加jquery中$.getJSON
- jquery中$.getJSON 的使用方法
- jquery中$.getJSON 的使用方法
- jquery中$.getJSON 的使用方法
- jQuery中ajax-$.getJSON,$.getScript
- jquery中 $.getJSON 的使用方法
- jquery中$.getJSON 的使用方法
- jquery中$.get()和$.getJSON()
- jquery中$.getJSON 的使用方法
- jQuery.getJSON()
- jQuery getJson
- jQuery中getJSON跨域原理详解
- Jquery中getJson函数用法实例详解
- jQuery中getJSON跨域原理详解
- Jquery中$.get(),$.post(),$.ajax(),$.getJSON()对比
- jquery.getJSON($.getJSON)用法
- jQuery中各Ajax函数:$.get(),$.post(),$.ajax(),$.getJSON()
- IOS开发 APNS消息推送实现
- 如何减少3D打印常见问题的方法以及发展方向
- 在Spring中使用Quartz任务调度支持集群(转载)
- 常用Grunt插件配置
- 一些自己总是忘记的内容
- jquery中$.getJSON()
- POJ 2601 Simple calculations
- Android App的签名打包(晋级篇)
- 3D打印发展领域面临的常见问题
- Android更新UI的方法
- linux各种下载地址
- 正则匹配
- [HTML/JS]利用JQuery的load函数动态加载其它页面的内容的实现代码代替Ifram
- Javascript(二)-04-(常见对象-String-自定义功能)