我尝试向“http://pastebin.com/raw.php”发出 JQuery ajax 请求' 并使用此代码:
$.ajax({
url: 'http://pastebin.com/raw.php',
data: "i=VJ29uFnk",
complete: function(jqXHR, textStatus) {
alert('complete');
},
success: function(data) {
alert(data);
},
error: function(xhr, status, error) {
alert('noh!')
}
});
有了这个,我在 xhr 中得到了状态“404”,但我在 Firebug 中看到的 url 看起来是正确的:
http://pastebin.com/raw.php?i=VJ29uFnk
想法?
最佳答案
XHR 调用受 Same origin policy 保护.
然而,您可以做的是调用一个服务器端脚本来绕过它。
关于javascript - JQuery Ajax 请求到 http ://pastebin. com/raw.php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16449492/