Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in opening a connection using AJAX call

 
Rinky Kaur
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not. JavaScript has a same domain policy. You must set up a proxy on the server.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic