JSON请求数据
开发工具与关键技术:Visual Studio
JavaScript对象表示法
撰写时间: 5月6号
作者: 曾子千
一、jQuery.get
JSON()的异步加载
- jQuery语法:jQuery.getJSON()(URL, [data], [callback])
2.原理:通过 HTTP GET
请求载入 JSON 数据。
3.参数:(1)url:发送请求地址。
(2)data:待发送 Key/value 参数。
(3)callback:载入成功时回调函数。
4.例子: $("#btnGetJson").click(function() {
$.getJSON("/jQueryAjax/selectInfor", function (data) {
console.log()data();
console.log()typeof ()data());
$.each()data, function ()i() {
str +=