How to get HTML from external contents with Jquery?
- by André
Hi,
I have successfully achieved the task of getting an internal webpage to show on my HTML, like I show bellow.
click here to see teste1.html
$('#target').click(function() {
$.get('teste1.html', function(data) {
$('#result').html(data);
alert('Load was performed.');
});
});
The main goal is to get an external webpage, but this is not working:
$.get('http://www.google.com/index.html', function(data) {
$('#result').html(data);
alert('Load was performed.');
});
I need to get the HTML from an external webpage to read the tags and then output to Json.
Some clues on how to achieve this(load external webpages with Jquery, or should I do it with PHP)?
Best Regards.