$(document).ready(function() {
var myDate = new Date();
var myMonth = myDate.getMonth();
var myDate = myDate.getDate();
var myJSON = $.ajax({
type: 'get',
url: 'http://api.juheapi.com/japi/toh?key=80e392fb7e8d782cf46c7dc1eab9db91&v=1.0&month=11&day=1',
data: {},
success: function(msg) {
alert(msg);
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus);
},
})
})
上段代码执行结果XMLHttpRequest.status为0,XMLHttpRequest.readyState为0,textStatus的值为error,怎么破?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你这个请求跨域了:
你跨域了。请先解决跨域问题。可以考虑服务器做一次代理。