<html>
<head>
<script src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
<div id="target-div"></div>
<div id="error"></div>
<div id="success"></div>
<script>
//$('#target-div').load('https://example.com.au');
$( "#success" ).load( "https://example.com.au #divId", function( response, status, xhr ) {
$( "#success" ).html( response );
if ( status == "error" ) {
var msg = "Sorry but there was an error: ";
$( "#error" ).html( msg + xhr.status + " " + xhr.statusText );
}
});
</script>
</body>
</html>
我得到了这个回复
抱歉,但出现错误:0错误
我尝试了<iframe>
但整个网站加载<iframe>
,而我只需要加载特定部分,我尝试使用div {<iframe>
但没有运气。