我正在使用XMLHttpRequest
.
它在 IE7 中运行良好,但是当我在 Firefox 中尝试相同时,我无法通过response.write
我正在使用以下功能:
<script type="text/javascript">
function ddSelect_Change() {
var xmlhttp;
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
xmlhttp = new XMLHttpRequest();
}
else if (window.ActiveXObject) { // IE
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
}
}
}
xmlhttp.onreadystatechange = function () {
//alert(xmlhttp.responseText);
if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
}
}
var url = "http://" + location.hostname + "Locationurl?Method=methodname";
xmlhttp.open("POST", url);
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlhttp.send();
}
添加
我有两个单独的 Web 应用程序,一个是 tridion Web 应用程序,另一个是自定义 Web 应用程序。我正在从 tridion Web 应用程序到自定义 Web 应用程序进行交互。两个 url 都有不同的域。并且状态我在 Firefox 中得到 0,而对于 readystate,我没有在我的警报中得到 (3)。