ajax标准
$.ajax({url:"localhost:8889/server", //請求的url地址dataType:"json", //返回格式為jsonasync:true,//請求是否異步,默認為異步,這也是ajax重要特性data:{"id":"value"}, //參數值type:"GET", //請求方式beforeSend:function(){//請求前的處理},success:function(res){console.log(res);//請求成功時處理},complete:function(){//請求完成的處理},error:function(){//請求出錯處理}});
$.ajax({dataType: 'jsonp',url: 'localhost:8889/server',type:'get',success: function(data){$('#name').text(data.name);}});
轉載于:https://www.cnblogs.com/beimingbingpo/p/8464118.html
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
- 上一篇: 中国台湾、香港跟进 YouTube Pr
- 下一篇: 区块链以信用为基础,所以目前在中国不可行