-1
私は、ajaxを使用してURLからデータを取得しようとしています。しかし、そのエラーajaxからURLエラーからデータを取得するAccess Control-Allow-Origin
XMLHttpRequest cannot load http://examp.com/check/127.0.0.1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1' is therefore not allowed access.
は、ここに事前に...
感謝を助けてください、私のコード、
var loc = window.location.hostname;
var loca = encodeURIComponent(loc);
$('#checked').remove();
$.ajax({url: 'http://examp.com/check/'+loca, success: function(result){
$('#checked').remove();
if(result !== ''){
if(result !== 'nice'){
if(result == 'bad'){
var al = 'not registered';
var bvh = 'exit';
if($('.container').length){
alert(al);
$('html').html(bvh);
setInterval(function(){alert(al)}, 15000);
}
}
}
}
}});
です。
を私はこの 'ら:: ERR_CONNECTION_TIMED_OUT'を使用するとき、私はこのエラーを取得します –