本文介绍了jQuery Ajax请求到http://pastebin.com/raw.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试向' http://pastebin.com/raw.php"并使用此代码:
I try to make a JQuery ajax request to 'http://pastebin.com/raw.php' and using this code:
$.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",但是我在萤火虫中看到的网址看起来是正确的:
With this I get a status '404' within xhr but the url I can see in firebug looks correct:
http://pastebin.com/raw.php?i=VJ29uFnk
想法?
推荐答案
XHR调用受相同来源的保护政策.
但是,您可以做的是调用服务器端脚本来绕过此脚本.
What you can do, however, is call a server side script that bypass this.
这篇关于jQuery Ajax请求到http://pastebin.com/raw.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!