Forum Moderators: open
I am working with a web application, based on Java Script and AJAX.
Just like other applications, I would like to have a page,stored in
my sever, after successfully loaded in the client browsers, connects to
other servers, for example Google API, to include the response text in the loaded page.I have tried using XMLHttpRequest and innerHTML method, but restricted by the holy "same origin policy".
The special requirement of my project is I have to have the users of
my application connect to other servers strictly with their IPs due to
security reason.
Is there any AJAX proxy method that can solved my problem?
Is there any method the break the same origin policy? I just need to
obtain the reponseText and need not to alter the pages in other server.
Thank
the URL your AJAX requests will look something like this:
[mydomain.com...]
Public APIs like Google Maps don't need that step. Instead, you hotlink some of their code directly onto your page with a <script> tag, and simply use the methods and properties provided by them. The <script> method doesn't heed any same origin policy, whereas XMLHttpRequest does.
By using a proxy running in my domain and output the response by curl method, it will be that it is my server connects to the third party web site.
The security requirement of my project is it is the clients of my application who are connecting the third party web site directly.
can you figure out a solution?