#6298 closed bug (fixed)
IE7,IE8 throw exception on new window.XMLHttpRequest();
Reported by: | name5566 | Owned by: | john |
---|---|---|---|
Priority: | high | Milestone: | 1.4.3 |
Component: | ajax | Version: | 1.4.2 |
Keywords: | IE7, IE8, xhr, XMLHttpRequest exception | Cc: | |
Blocked by: | Blocking: |
Description
Microsoft failed to properly implement the XMLHttpRequest in IE7 and IE8.
Test Case: <!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01 TransitionalEN" "http://www.w3.org/TR/html4/loose.dtd"> <html>
<head>
<script src="js/jquery/jquery-1.4.2.js" type="text/javascript" charset="utf-8"></script> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>index.html</title> <script type="text/javascript" charset="utf-8">
$(function() {
$('a').click(function() {
$('div').load('register.html'); return false;
});
});
</script>
</head> <body>
<div></div> <a href="register.html">Here</a>
</body>
</html>
Open the IE8 or IE7 and then click the link(register.html) if you open the page, don't reload the page, and click the link at the first time.
IE7 window.XMLHttpRequest will throw a exception: Permission Denied IE8 window.XMLHttpRequest will throw a exception: Object don't support this property or method
if you reload the page, and click, on exception throw.
I try to fix it: xhr:function() { return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); },
it be well.
Attachments (1)
Change History (7)
Changed 13 years ago by
Attachment: | index.html added |
---|
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Note that the user (or in a company, the admin with the IEAK) has the ability to disable the "native" XMLHttpRequest object introduced starting in IE7. If you are encountering situations where the native object no longer works, check IE Tools, Internet Options, Advanced, Security, "Enable native XMLHTTP support."
There doesn't appear to be any way to tell when XHR has been disabled, and the document.XMLHttpRequest check still succeeds in IE even though it's disabled.
comment:3 Changed 13 years ago by
need: | Patch → Commit |
---|---|
Owner: | set to john |
Priority: | → undecided |
comment:5 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
use case