I have successfully achieved the task of getting an internal webpage to show on my HTML, like I show bellow.
<!doctype html>
<html>
<head>
<script type="text/javascript" src="jquery-1.4.4.js"></script>
</head>
<body>
<div id="target">
click here to see teste1.html
</div>
<div id="result">
</div>
<script type="text/javascript">
$('#target').click(function() {
$.get('teste1.html', function(data) {
$('#result').html(data);
alert('Load was performed.');
});
});
</script>
</body>
</html>
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)?