Solved

XMLHttpRequest open method gives permission denied error

Posted on 2008-06-17
3
1,785 Views
Last Modified: 2008-06-24
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
Comment
Question by:baboa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
rowejd earned 500 total points
ID: 21806062
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
 
LVL 82

Expert Comment

by:hielo
ID: 21807361
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
 
LVL 12

Expert Comment

by:rowejd
ID: 21858681
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question