次の問題があります。私のウェブアプリはで実行されています
http://webapp.mysite.com/browser/
そしてお願いしたいのは
http://mysite.com/request?....
2 番目の URL で標準的な ajax 呼び出しを行うと、エラー メッセージ、ドメイン (同一オリジン) ポリシー エラーが表示されます。
[object Object]-error-[Exception...
"Component returned failure code: 0x80004005
(NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)"
location: "JS frame :: ..../scripts/jquery/js/jquery-1.4.4.min.js ::
anonymous :: line 16" data: no]
今、私はこの ajax php プロキシを試して問題を解決しました。しかし、スクリプトはコンテンツを返しません。
var app = 'http://www.mysite.com/rest.php?request=credits';
var proxy = 'proxy.php?proxy_url=' + app;
$.ajax({
url: proxy,
cache: false,
async: false,
dataType: 'html'
success: function(html){
alert(html);
},
error: function(){
}
});
何か案は?