Tuesday, May 16, 2006
Ajax problem when leaving "www." out of domain
I'll be posting some technical articles and podcasts I'm developing in the next few days, but a co-worker of mine inadvertently stumbled upon a rather annoying error just now. He navigated to a web app I did using an Ajax remote scripting call without typing "www." in the domain name.
Oddly, MSIE 6.x threw a JavaScript error, saying 'Permission denied'. However, the app as designed works perfectly as long as the predicate is in the URL. Anyone know what/s up with this?
Oddly, MSIE 6.x threw a JavaScript error, saying 'Permission denied'. However, the app as designed works perfectly as long as the predicate is in the URL. Anyone know what/s up with this?
Comments:
Links to this post:
<< Home
I wonder if it has something to do with the path to the remote script set in the 'URL' argument of XmlHttpRequest.open(). I'm declaring this value as a JavaScript variable of global scope within my library, explicitly specifying the 'WWW.' in my value.
Maybe this has something to do with it...
Maybe this has something to do with it...
My guess is SSL. If the cert says www, then you could get an access denied when using HttpXMLRequest.
Hey Jason,
I think I stumbled across the same problem your co-worker did when I navigated to http://kuam.com instead of http://www.kuam.com - the tag cloud component errors out on IE with a javascript pop-up error - on Firefox it's a little less obvious, it loads the page with no complaints but of course the tag cloud is empty.
This is your current implementation:
var xmlhttp;
var method = 'GET';
var url = 'http://www.kuam.com/kuamscripts/js/ajax/getsearchtagcloudkeywords.aspx';
function getTagCloudSearchItems() {
createXmlHttpRequest();
xmlhttp.open(method,url,true);
xmlhttp.onreadystatechange = handleResponse;
xmlhttp.send(null);
}
Have you tried changing the "url" setting to "/kuamscripts/js/ajax/getsearchtagcloudkeywords.aspx"
leaving out the "http://www.kuam.com" prefix?
Let us know what you find..
Thanks,
jonah
I think I stumbled across the same problem your co-worker did when I navigated to http://kuam.com instead of http://www.kuam.com - the tag cloud component errors out on IE with a javascript pop-up error - on Firefox it's a little less obvious, it loads the page with no complaints but of course the tag cloud is empty.
This is your current implementation:
var xmlhttp;
var method = 'GET';
var url = 'http://www.kuam.com/kuamscripts/js/ajax/getsearchtagcloudkeywords.aspx';
function getTagCloudSearchItems() {
createXmlHttpRequest();
xmlhttp.open(method,url,true);
xmlhttp.onreadystatechange = handleResponse;
xmlhttp.send(null);
}
Have you tried changing the "url" setting to "/kuamscripts/js/ajax/getsearchtagcloudkeywords.aspx"
leaving out the "http://www.kuam.com" prefix?
Let us know what you find..
Thanks,
jonah
btw you might also want to consider a better abstraction layer when building Ajax components - here's a nice example of one: http://prototype.conio.net/
Hey Jonah...yeah...changing the URL to a root-relative path did it. Weird - none of the documentation mentions this. I only starting placing the URL argument in a global variable recently, so there's one to grow on. :)
Thanks for the tip!
Thanks for the tip!
Jason,
No problem, nice to hear that worked! I also see you've made good progress with the consistant look and feel for most of your site - just a few pot-holes here and there but I'm sure you'll smoke them out.
Btw I asked you earlier about becoming a member of your "KUAM.com Beta Tester Community" - What do I need to do to sign up? More eyes on the product before you release it might help perhaps?
No problem, nice to hear that worked! I also see you've made good progress with the consistant look and feel for most of your site - just a few pot-holes here and there but I'm sure you'll smoke them out.
Btw I asked you earlier about becoming a member of your "KUAM.com Beta Tester Community" - What do I need to do to sign up? More eyes on the product before you release it might help perhaps?
I've already got our Beta Community reviewing a few projects at the moment, but send me your e-mail address to jason @ kuam.com and I'll post your name. I'll also mention them here, so stay subscribed!
Links to this post:
<< Home
Subscribe to Posts [Atom]


Post a Comment