Solved

XMLHttpRequest open method gives permission denied error

Posted on 2008-06-17
3
1,778 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delay Form Submission without touching existing code? 5 22
jQuery delay animation 3 29
JavaScript let vs var 5 25
Adding Row and Cell on a table 14 19
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

770 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