Download external content using AJAX

Is it possible to load the contents of an external site using jQuery Ajax, and not iFrame?

This is what I'm trying to achieve, but it looks like there might be cross domain issues with this?

$('#result').load('http://www.google.com');

In Flash, you can put the cross-domain policy policy file at the root of the site so that certain sites can access the contents of swf files or other files. Is this something that can be done using AJAX?

Thanks James

0
source share
2 answers

Perhaps in part. You need your server to act as a proxy:

$('#result').load('fetch.php?s=http://www.google.com');
// or something like that

As for the client loading the cross-domain of the page, it will not (should not) be possible.

+2
source

Is it possible to load the contents of an external site using jQuery Ajax, and not iFrame?

. , JSON-P .

Flash , swf . -, AJAX?

-, ( )

+1

Source: https://habr.com/ru/post/1752710/


All Articles