我的代码没有任何输出,请帮助。到目前为止我的代码是:
$.ajax({
url: "http://cricketapi.herokuapp.com/getMatches",
crossOrigin: true,
dataType: "json",
success: function (data) {
alert("heyy succes");
},
error: function (xhr, textStatus, errorMessage) {
alert("error");
}
});
发布于 2018-07-09 16:48:30
如果你已经创建了这个RESTfulAPI,那么你必须通过添加以下(Php)来允许CORS:
<?php
header("Access-Control-Allow-Origin: *");
https://stackoverflow.com/questions/-100005561
复制相似问题