Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to load a cross domain web page through AJAX?

I'm currently developing a mobile web application with jQM.

Although I looked for answers to my question, I couldn't find any good answers.

Here is my goal:

  1. Downloading a specific element of a webpage in another domain.
  2. Show the data through a dialog.

I'm stuck with the first step because of the cross-domain issue.

Some people writes about using JSONP with a callback function, but it seems that the technique only works when handling JSON format.

I also read that because of the security issues, JavaScript doesn't support downloading the html page in another domain.

Are they right?

There is no way to achieve my goal through JavaScript?

like image 824
Sungam Yang Avatar asked Nov 29 '22 13:11

Sungam Yang


1 Answers

There are many workarounds for this issue (JSONP, reverse proxy, 'Access-Control-Allow-Origin', etc..) described in a very extensive thread here on SO: Ways to circumvent the same-origin policy

like image 81
Zim Avatar answered Dec 05 '22 00:12

Zim