$scope.netping =function (url,e) { url = $scope.urlForm.url; $.ajax({ type: 'get', cache: false, url: url, dataType: "jsonp", //跨域采用jsonp方式 processData: false, //timeout:10000, //超时时间,毫秒 complete: function (data) { if (data.status==200) { $scope.updateUrl(e); } else { layer.msg("无效链接"); } } }); }
转自:https://blog.youkuaiyun.com/oftoo/article/details/52858033
jQuery.ajax中success 和complete 区别:
文章详情:https://blog.youkuaiyun.com/zhbitxhd/article/details/9946799