View Full Version : IE7 Error Message Access denied

05-18-2007, 03:38 PM
Good day-

I have an ajax function that allows me to load pages into a specified div

link here for the script http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm

this may be due to rendering locally, but it works fine in Fire Fox, however in IE7 the error message appears

any thoughts?

05-18-2007, 04:51 PM
Check your security settings. In IE7, the default settings for cross-domain data access were set to "deny" for all security zones. (Tools -> Internet Options -> Security -> Custom Level -> “Access data sources across domains” checked or not) It may also be set to not allow active-x controls or plug-ins to run.
If it's a problem with security settings, you can fix it on your computer, but it won't work on other computers that haven't done so.

05-18-2007, 04:56 PM
That script doesn't work locally in IE 7. If it works in FF once the page is live, it should work in IE 7 once the page is live. If you need to use the script primarily locally, it can be modified to also work locally in IE 7, but if the primary use will be live, it is best not to alter the code.

05-18-2007, 06:56 PM
thanks, i will try it live on the server and see if it works...

ill let you know

thanks again

06-11-2007, 04:47 PM
How could I modify this code work on the local drive?

06-11-2007, 04:55 PM
Reverse the order and the sense of the opening tests (changes red):

function ajaxpage(url, containerid){
var page_request = false
if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
catch (e){
page_request = new ActiveXObject("Microsoft.XMLHTTP")
catch (e){}
else if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
return false
loadpage(page_request, containerid)
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()

But, as the XMLHttpRequest is more efficient and can be used live by IE 7, this shouldn't be used with a live implementation. It will allow for local testing in IE 7, and, if your primary usage will be local, is perfectly fine.