shane07 Posted October 29, 2008 Share Posted October 29, 2008 Here is my xmlrequest code if(window.ActiveXObject) { xmlRequest = new ActiveXObject("Microsoft.XMLHTTP"); } else { xmlRequest = new XMLHttpRequest(); } xmlRequest.open("GET", pageUrl, true); xmlRequest.send(null); xmlRequest.onreadystatechange=function() { if(xmlRequest.readyState==4) alert(xmlRequest.responseText); } It works fine in www.mysite.com but in mysite.com (without www) it doesn't work both in IE and firefox. Infact there is an error which says 'uncaught exception:[Exception... "Access to restricted URI denied" (In firefox). IE says 'Permission denied' when clicking on yellow question mark Link to comment https://forums.phpfreaks.com/topic/130628-works-in-wwwmysitecom-but-not-in-mysitecom/ Share on other sites More sharing options...
corbin Posted October 29, 2008 Share Posted October 29, 2008 The domain/subdomain have to match. My guess would be that pageUrl is an absolute URI which points to www.mysite.com. AJAX cannot cross domains, thus, you are getting an access error. Link to comment https://forums.phpfreaks.com/topic/130628-works-in-wwwmysitecom-but-not-in-mysitecom/#findComment-677835 Share on other sites More sharing options...
BoltZ Posted October 30, 2008 Share Posted October 30, 2008 Could you perhaps show us your site in which this error occurs? ^^ Link to comment https://forums.phpfreaks.com/topic/130628-works-in-wwwmysitecom-but-not-in-mysitecom/#findComment-678074 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.