My use of AJAX is coming along nicely, BUT - I have noticed something strange! On my development machine, if I load a page on my local webserver (Apache 2 runing under Debian Etch) via it's IP address, AJAX works fine. However, when I load it via the L.O. (localhost), I get the javascript error uncaught exception: Permission denied to call method XMLHttpRequest.open.
Weird.
Any ideas, without seeing my code? I'll post if it will help.
If the server part of the url in the address bar is different to the server part of the address you are calling via AJaX then security permissions kick in.
If you are loading the page initially using the IP address, then you should call the AJaX through that address.
If you are using localhost then the same should be used for the AJaX.
This may seem strange at first because they are essentially the same machine. The security settings don't know that localhost and your IP address are the same. Your IP address could change.
If that's not the case do you access the internet via a proxy? I know that sounds daft when you are accessing localhost, but my work pc needs to go through the proxy to access my localhost server. If this is the case, then the proxy may be returning the code as if it from the IP address even when you have localhost in the address bar. In which case, the quick solution is just to use the IP address.
by default in the security settings (for windows based machines anyways) localhost is in the restricted zone, adjust your security settings in internet explorer under zones.
__________________
-Mike
"Want me to precludify him, like some kind of dispatcherator?... Can do!" -Bender
I'm having the same problem as mlse, but I've tried everything I could find on the internet to solve my permissions problem with no success.
I'm using Windows XP Pro SP2 (32 bit, IIS 5) and I've tried the following:
The above suggestion of making localhost a trusted site;
I made sure that my localhost is a trusted site (as suggested above);
Tried to use my own IP address instead of localhost;
I set my folder to be Shared and allow other users to change my files;
I made sure my folder was set with full permissions to everyone (as suggested here;
In IIS, I checked Anonymous login and made sure that the login is my username;
Shared the folder, and also set it shared to internet users;
...and I still can't save files using an upload form. I keep getting an access denied error. I know that it's my own machine because my script works fine in other environments. Did I miss anything?