给 iframe
标签添加 onload
事件,如下
<iframe src="引用链接" width="100%" name="demo"
id="demo" frameborder="0" onload="this.height=this.contentWindow.document.body.scrollHeight"
sandbox="allow-same-origin allow-top-navigation allow-forms allow-scripts allow-popups">
</iframe>
关键性的代码是
οnlοad="this.height=this.contentWindow.document.body.scrollHeight"