Can anyone enlighten me as to why the following code won't work in IE7 but it works just fine in Chrome/Firefox?
$(document).ready(function(){
$.ajax({
type: "POST",
dataType: "text",
cache: false,
url: "/ajax/ajax.asp",
data: "cmd=check_forfeits",
success: function(msg) {
return false;
}
});
});
The javascript error IE throws out is 'Permission Denied'
If I remove that bit of code from the JS file for the page in question the page works just fine, no errors, so the error lies in that bit of code I believe.
:::UPDATE:::
Something else that is a little strange is that when I refresh the page (in IE7) I get no javascript errors and this code seems to work correctly. So it's as if the first time the page loads this code snippet errors but after that it runs just fine.
:::UPDATE:::
Here are the fiddler posts for this page from IE7:
# Result Protocol Host URL
1 200 HTTP 192.168.47.13:8000 /
2 304 HTTP 192.168.47.13:8000 /js/jquery-1.4.1.js
3 200 HTTP 192.168.47.13:8000 /js/index.js
4 304 HTTP 192.168.47.13:8000 /js/jquery-1.4.1.js
5 200 HTTP 192.168.47.13:8000 /js/index.js
6 304 HTTP 192.168.47.13:8000 /css/main.css
7 304 HTTP 192.168.47.13:8000 /css/grid.css
8 304 HTTP 192.168.47.13:8000 /images/banner.jpg
Here are the fiddler posts for this page from Firefox:
# Result Protocol Host URL
1 200 HTTP 192.168.47.13:8000 /
2 304 HTTP 192.168.47.13:8000 /js/jquery-1.4.1.js
3 304 HTTP 192.168.47.13:8000 /js/index.js
4 304 HTTP 192.168.47.13:8000 /css/grid.css
5 304 HTTP 192.168.47.13:8000 /css/main.css
6 304 HTTP 192.168.47.13:8000 /images/banner.jpg
7 200 HTTP 192.168.47.13:8000 /ajax/ajax.asp
This problem occurs when a designer has incorporated JavaScript and Ajax enhancements into their website’s architecture without making provisions for browsers that have disabled JavaScript.
Although the content is fully accessible with JavaScript disabled, most users will see the enhanced Ajax-driven version. The principle of progressive enhancement for Ajax is well known, because it is commonly used for unobtrusive JavaScript techniques and is inherent in CSS, as illustrated by the graphic below:
A similar graphic or indicator could be used at the end of an Ajax request to tell users that content has been updated. This would be implemented in addition to, not instead of, the progress indicator proposed for the previous problem. A similar but subtler way to indicate that an area of content has been updated is the yellow fade technique.
Although the details of this solution are far beyond the scope of this article, we’ll go over the basic principle at work. Because an Ajax request originates in the client’s browser, it must reference a file at another location but on the same domain as the source of the request.
if people happen to find this page because they're experiencing the same error - I just found another cause / solution for IE7 failing with this "PERMISSION DENIED" error and succeeding on a refresh.
Make sure that if you're using this in your <head>
tag:
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
Note that it does not have any capital letters or a space after the ";". Our site had this version:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
and that caused the same behavior when making AJAX calls.
Hopefully this helps someone else, because we just spent about 6 hours figuring this out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With