1) Script Title: Dynamic Ajax Content
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...jaxcontent.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/s...c+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/dynamici...jaxcontent.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 scriptand the first XMLHttpRequestCode:var page_request = falsewith the "UPDATED CODE" below.Code:if (window.XMLHttpRequest) // if Mozilla, Safari etc
UPDATED CODE:
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)




Reply With Quote

Bookmarks