Native aJax cross-domain

Encountered a problem today, take advantage of native ajax request Times for some wrong,

 

 Probably means the same origin policy prevents access, that is, cross-domain,

I later found to send the request header in the code,

xhr.setRequestHeader();
After deleting this code, you can normally request the data.

Guess you like

Origin www.cnblogs.com/gzy-tw/p/11613406.html