【发布时间】:2018-02-16 03:05:34
【问题描述】:
<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>,而我只需要加载特定部分,我尝试了“<iframe> with div id 但没有运气。
【问题讨论】: