当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - On IE10 page with JS script reloads for some reason. How can I do detailed debug?

问题描述:

I have legacy project, where I have problem with browser compatibility. It work perfect on IE10 in modes of IE 7,8,9 and 10 compatibility, but in mode IE10 page reloads for some reason.

Script of this page just dynamicly performes xml-request and load result in specific box.

function sendXmlRequest( xmlRequest )

{

var conn;

conn = new ActiveXObject("MSXML2.XMLHTTP");

var xmlStatusElement = document.getElementById("xmlStatus");

xmlStatusElement.innerHTML = 'Sending request...';

var xmlRequestElement = document.getElementById("xmlRequest");

xmlRequestElement.innerHTML = '';

xmlRequestElement.innerHTML = "<pre>" + escapeXml( xmlRequest ) + "</pre>";

var indicatorImage = document.getElementById( "indicatorImage" );

indicatorImage.style.display="inline";

conn.open("POST","/some_url",true );

conn.onreadystatechange = function( aEvt )

{

var xmlResponseElement = document.getElementById("xmlResponse");

var loadButton = document.getElementById("loadButton");

if(conn.readystate == 2)

{

xmlResponseElement.innerHTML = "<pre>Waiting for response...</pre>";

}

else if ( conn.readystate == 3 )

{

xmlResponseElement.innerHTML = "<pre>Receiving for response...</pre>";

}

else if ( conn.readystate == 4 )

{

var xmlResponse = conn.responseText;

xmlResponseElement.innerHTML = '';

xmlResponseElement.innerHTML = "<pre>" + escapeXml( xmlResponse ) + "</pre>";

indicatorImage.style.display = "none";

xmlStatusElement.innerHTML = conn.statusText + " (" + conn.status + ")";

loadButton.disabled = false;

}

else

{

loadButton.disabled = true;

}

};

conn.send( xmlRequest );

}

So the problem is that after executing block with condition conn.readystate == 4, there is sudden reload of page in IE10 mode. In other modes under debug in IE developer window, executing of script stops after this block, but in case of IE10 mode debug comes to 3rd party script coolmenu 4.06 (2002) which include in top of page, and start to rebuild menus as it performs during loading of page. So reload already triggered by some hidden event and I can not catch what is triggered this under debug.

So could somebody give me the reason why in IE10 reload performs (I`m talking about exact reason, not just general phrases about IE diff between versions)? Or advice some debug tool that will allow me to catch what triggers reload, so I will find reason of reloading and fix it, so in IE10 mode there will not be reload.

分享给朋友:
您可能感兴趣的文章:
随机阅读: