我正在尝试向特定网站发送HTTP请求,但我遇到错误:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.google.com/. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
例如,我想向Google.com发送请求并收到HTML回复。 我的代码是使用JQUERY AJAX编写的:
function sendRequest(URL) {
$.ajax({
type:'GET',
url:URL,
success:function(result){console.log(result);}
});
}