html5 - 如何用div語法在一個html里插入另外一段html(或者文件)代碼并完整顯示
問題描述
這個是寫出來的效果
這個是原圖html效果
<iframe src='http://www.piao2010.com/wenda/test12.html' name='iframepage' frameBorder=0 scrolling=no onLoad='iFrameHeight()' ></iframe>這個是代碼請問怎么才能顯示完整呢?方便的話請提供一下完整代碼。。
這里是前半段的代碼<!DOCTYPE html><html> <head>
<title>data</title><meta charset='utf-8'><meta name='author' content='2' /><link rel='stylesheet' href='http://www.piao2010.com/wenda/zh-CN.css' type='text/css' />
</head> <body>
<textarea id='source'>
class: center, middle, inverse, title-slide
data123<iframe src='http://www.piao2010.com/wenda/test12.html' name='iframepage' frameBorder=0 scrolling=no onLoad='iFrameHeight()' ></iframe>
class: inverse, center, middle
問題解答
回答1:試試這個可以嗎
function iFrameHeight() { document.getElementById('iframepage').style.height = window.frames[’iframepage’].document.documentElement.scrollHeight + ’px’;}
相關文章:
1. css - 如何把一個視圖放在左浮動定位的視圖的上面?2. python的正則怎么同時匹配兩個不同結果?3. php多任務倒計時求助4. javascript - axios請求回來的數據組件無法進行綁定渲染5. javascript - vue中怎么使用原生js插件6. MySQL的聯合查詢[union]有什么實際的用處7. javascript - jquery怎么讓a標簽跳轉后保持tab的樣式8. css - 子元素跑到父元素外面9. javascript - 小demo:請教怎么做出類似于水滴不斷擴張的效果?10. javascript - 請問下面代碼中的...是擴展運算符還是操作運算符?這樣寫是什么意思?
