# Other Programming > AJAX >  uncaught exception: Access to restricted URI denied (NS_ERROR_DOM_BAD_URI)

## ariell

Hi there,

I am first and foremost used to C code, stuff that has to be compiled prior to its usage. Now, confronted with that "asynchronous javascript and xml" (as I learned this name is abbreviated for), I am running into that problem:

uncaught exception: Access to restricted URI denied (NS_ERROR_DOM_BAD_URI)
(showing up after XMLHttpRequest() is properly initialized, on invocation of its open()-method)

Thanks to FireBug, I FOUND this error. I have serious doubts that otherwise I could have catch it. The "restricted URI" is "everything" - no matter whether I've put the destination to a root folder or SOMEwhere, this exception sustains.

Any AJAX guru(s) who feel they can help me out?

Thanks in advance.

----------


## ariell

Done. I've found a solution. One more evidence that AJAX is not a "system" but just an idiom.
And thanks for the tons of help!

----------


## matias1331

hi, I'm having the same problem, can you plz explain how you fix it?', what the problem might be??, what's the solution??.

thx in advnace
Daniel

----------


## ariell

What EXACTLY is your problem?

In MY case, it was something like "request.open("GET",url,true)" whereas url was (out of the sudden) considered "restricted".

Let me know.

----------


## antranidox

i found out that:

this don't work!
request.open("GET", "http://www.thedomainname.com/resp.php?wohin=" + wohin, false);

this works:
request.open("GET", "http://thedomainname.com/resp.php?wohin=" + wohin, false);
(without "www")

----------


## farazilu

i am having the same problem when page is onpen in HTTPS. but removing www does not work for me is there any other soloutin??

----------


## PeejAvery

> i found out that:
> 
> this don't work!
> request.open("GET", "http://www.thedomainname.com/resp.php?wohin=" + wohin, false);
> 
> this works:
> request.open("GET", "http://thedomainname.com/resp.php?wohin=" + wohin, false);
> (without "www")


That is because cross-domain references are not allowed. You probably had accessed the site without the www, so it would have to be without the www in the AJAX request as well.




> i am having the same problem when page is onpen in HTTPS. but removing www does not work for me is there any other soloutin??]


Are you attempting to access a different domain than the one you to which you are already connected? As already mentioned, AJAX does not allow cross-domain references.

----------

