How can I load a webpage from a different domain in a div in a .asp page? I´m using the below and both works, it loads a div from one page on my domain into another page on my domain. But how can I do this if it is another domain?
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type="text/javascript" src="js/jquery.xdomainajax.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#external').load('http://www.mypage.com/page2.html #page2');
$('#mydiv').load('http://www.mypage.com/page2.html #page3', function(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
alert(msg + xhr.status + " " + xhr.statusText);
}
});
});
</script>
</head>
<body>
<div id="external"></div>
<br><br>
<div id="mydiv"></div>
</body>
</html>
Thanks!