使用jQuery来发送 AJAX 请求会比较方便
使用jQuery 发送get和post请求get和post请求有四个参数:
$.get(url,[data],[callback],[type])
url:请求的 URL 地址。
data:请求携带的参数。
callback:载入成功时回调函数。
type:设置返回内容格式,xml,html,script,json,text,_default。
12345678910111213 //发送get请求$('button').eq(0).click(function(){ $.get('http://127.0.0.1:8000/jquery-server', {a:100, b:200}, function(data){ console.log(data); }, ...
.jpg)