Closed wonleing closed 8 years ago
查到了这样的描述
var invocation = new XMLHttpRequest();
var url = 'http://bar.other/resources/public-data/';
function callOtherDomain() {
if(invocation) {
invocation.open('GET', url, true);
invocation.onreadystatechange = handler;
invocation.send();
}
}
请明示如何加到client端?
你在服务端这个接口的 response header 里加这个就好了
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS
分别放在两个server上会报json decode error, network error