$("#btnOK").click(function() { $.ajax({ url:'接口地址', type:'GET', //GET async:true, //或false,是否異步 timeout:5000, //超時時間 dataType:'json', //返回的數據格式:json/xml/html/script/jsonp/text beforeSend:function(xhr){ console.log(xhr) console.log('發送前') }, success:function(data,textStatus){ console.log(data) console.log(textStatus) console.log(jqXHR) }, error:function(xhr,textStatus){ console.log('錯誤') console.log(xhr) console.log(textStatus) }, complete:function(){ console.log('結束') } }) });
【statustext no transport】問題javascript