get:
function fget() { {#发送get请求#} {#alert('测试用');#} $("#btn").click(function () { $.ajax({ url: '../taskajax1/', type:"get", data:{ n1:"test" }, success:function (res) { console.log(res) } }); }); }
post:
function fpost() { {#发送post请求#} $.ajax({ url: '../taskajax1/', type:"post", data:{ n1:"test" }, dataType:"JSON", success:function (res) { console.log(res.name2) } }); }
post+form表单提交数据
function getformdata() { $("#btn9")