Athrill
05-23-2007, 07:37 AM
1) Script Title: Dynamic Ajax Content
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
3) Describe problem: When previewing content locally in IE7 using the "Dynamic Ajax Content" script, you get an "Access Denied" error and the dynamic pages doesn't appear, but works remotely from a web server.
This issue is discussed in several threads, e.g. http://www.dynamicdrive.com/forums/showthread.php?t=15642&highlight=Dynamic+Ajax+Content
I was able to append the javascript so one can now work and preview changes offline/locally. Not that i'm boasting by any means, just that after looking for a solution to this and not finding an easy one, I decided to try and make a workaround of my own.
Please let me know if this is helpful to anyone or if it creates any problems.
~peace,
Athrill
++++++++++
THE HOW TO:
Assuming you are using the cut-and-paste Dynamic Ajax Content script (http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm) from "Step 1" and haven't made any heavy modifications, this should work fine, although being a somewhat novice coder, I don't guarantee this modification ;)
1. Replace the code between (keeping these two lines in tact) the 5th variable from the top of the script
var page_request = false and the first XMLHttpRequest
if (window.XMLHttpRequest) // if Mozilla, Safari etc with the "UPDATED CODE" below.
UPDATED CODE:
if (rootdomain) // if accessing remote server (not locally)
if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else // if accessing locally (not remote server)
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
3) Describe problem: When previewing content locally in IE7 using the "Dynamic Ajax Content" script, you get an "Access Denied" error and the dynamic pages doesn't appear, but works remotely from a web server.
This issue is discussed in several threads, e.g. http://www.dynamicdrive.com/forums/showthread.php?t=15642&highlight=Dynamic+Ajax+Content
I was able to append the javascript so one can now work and preview changes offline/locally. Not that i'm boasting by any means, just that after looking for a solution to this and not finding an easy one, I decided to try and make a workaround of my own.
Please let me know if this is helpful to anyone or if it creates any problems.
~peace,
Athrill
++++++++++
THE HOW TO:
Assuming you are using the cut-and-paste Dynamic Ajax Content script (http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm) from "Step 1" and haven't made any heavy modifications, this should work fine, although being a somewhat novice coder, I don't guarantee this modification ;)
1. Replace the code between (keeping these two lines in tact) the 5th variable from the top of the script
var page_request = false and the first XMLHttpRequest
if (window.XMLHttpRequest) // if Mozilla, Safari etc with the "UPDATED CODE" below.
UPDATED CODE:
if (rootdomain) // if accessing remote server (not locally)
if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else // if accessing locally (not remote server)