我有:
index.html
和
test.html
我可以用 jquery load(); 加载我的 test.html
; index.html
但是我的 index.html 样式被破坏了,这就是为什么我想将我的 test.html
作为 iframe 加载到 index.html
中..
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<h1>index.html</h1>
<div class="item">
load test.html here with iframe
</div>
<div class="test">
I'm a test div and I want to be in index.html in `item` class
</div>
最佳答案
将 html 文件加载到 iframe 中
<html>
<body>
<iframe src="test.html">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
关于javascript - 如何使用 iframe 加载 html?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44436836/