这是我的代码:
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
</body>
</html>
<div id="content"></div>
<div id="mydiv">
<iframe id="frame" src="http://example.com/" width="100%" height="300">
</iframe>
</div>
<script type="text/javascript">
$(window).on('load',function(){
var iframeContent = $("iframe").contents();
$("#content").html(iframeContent);
});
</script>
iframe块准确显示src的内容。但是iframeContent为空。我怎么了?