Possible Duplicate:
SCRIPT5: Access is denied in IE9 on xmlhttprequest
Consider the following HTML code :-
<!-- Check for XMLHttpRequest object in IE 9 -->
<html>
<body>
<script type="text/javascript">
if(window.XMLHttpRequest){
alert("XMLHttpRequest supported by browser");
xhttp = new XMLHttpRequest();
xhttp.open("GET", "books.xml", false); <!-- Line 1 -->
alert("reching??");
xhttp.send();
}
if(window.ActiveXObject){
alert("ActiveXObject supported by browser");
}
</script>
</body>
</html>
As per W3C, IE7+ supports XMLHttpRequest object. I am using the same for IE9.
Yes, the object is supported by IE9 as a get the alert for the same. However, XMLHttpRequest's method open is not working. Browser stops at the line 1 shown in the above code.
Why is it so??
I also searched a Microsoft's link. Two different ways of creating XML HTTP Request Object is shown :
xhttp = new XMLHttpRequest;
xhttp = getXMLHttpRequest();
1st way gives the same problem at open method. 2nd way returns a null object. In the same link, I also found that many people are facing the same problem with open method of XMLHttpRequest object in IE but I guess no solution is written there too. :(