Two Laptop Bag*
The moose likes HTML, CSS and JavaScript and the fly likes Exception in opening a connection using AJAX call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Exception in opening a connection using AJAX call" Watch "Exception in opening a connection using AJAX call" New topic
Author

Exception in opening a connection using AJAX call

Rinky Kaur
Greenhorn

Joined: Nov 03, 2008
Posts: 7
when I made a connection on the same server at different port using AJAX call in FireFox browser
xmlHttp=new XMLHttpRequest();
xmlHttp.open("GET", url,true);
I got the exception
[Exception... "Access to restricted URI denied" code: "1012" ....]
I discovered this is for security reasons in Firefox.

Is there a solution to it? ie,Can we MAKE AN A CALL USING AJAX on different domain? HOW?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can not. JavaScript has a same domain policy. You must set up a proxy on the server.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception in opening a connection using AJAX call
 
Similar Threads
FF continually working after removing a dynamic hidden iframe
Calling WebService using plain JavaScript
IE6 Won't make more than one AJAX request.
help required specifying Transation attributes for this scenario
Is it possible to make controls on h:dataTable work after a back button has been used.