• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1799
  • Last Modified:

XMLHttpRequest open method gives permission denied error

The XMLHttpRequest open method gives a permission denied error when I call a page from a different domain. Is there any permanent solution to get around this error?
0
baboa
Asked:
baboa
  • 2
1 Solution
 
rowejdCommented:
Javascript has a same-origin policy.  You'd have to set up a proxy script if you own both domains/sites.  If you don't own the other site, though, you cannot do this.
0
 
hieloCommented:
This is a security restriction imposed by the browser. The page you are trying to retrieve MUST be from the same domain as the page requesting/retrieving the remote page. However, this restriction does NOT exist on the server. What you need is to have our page send the request to some script on YOUR server and then have the server retrieve the remote page, and lastly, once the content is retrieved, pass it onto your page.
0
 
rowejdCommented:
Does this help baboa?  We'd be glad to help more if not.  I can supply a proxy script if you need one, but as we both stated the same-origin security policy prevents cross domain XML-HTTP (ajax) requests.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now