0
次のコードに問題があります。 IE8で実行すると、通話から正常に復帰したときに警告が表示されます。FirefoxとChromeではAjax POSTで問題はIE8ではありません
これはFirefoxとChromeでは発生しません。つまり、Firefoxを実行しているときに警告は表示されません。 他のすべては動作しますが、呼び出しが成功すると実行されるはずのコードセクションのように思えます。
function stuffFile(file, wfid) {
var xmlhttp = new XMLHttpRequest();
if(window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
var url = "http://someotherserver.page.aspx";
var params = "fileName=" + file + "¶m11=" + wfid;
xmlhttp.open("POST", url, true);
//Send the proper header information along with the request
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.onreadystatechange = function() {//Call a function when the state changes.
//alert('onready');
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var response = jQuery.trim(xmlhttp.responseText);
alert('response ' + response);
}
}
xmlhttp.send(params);
}
クロムの作品http://jsfiddle.net/wGeAY/(おそらくurl/paramsを変更しました)おそらく別の場所です。あなたは明らかにあなたのスタックにjQueryを持っています。単純なajax機能を使わないのはなぜですか? –
コンソールでデバッグしようとしましたか? – j08691
問題は、URLが別のドメインにあることです。 Firefoxでは許可されていません – oneiros