主页面为main.html,点击在div添加html按钮id为btn,
div的id为viewDiv,要插入的本地html为new.html。
方法一:基于Jquery的DIV嵌套html(测试可用)
- 1
- 1
- 2
- 3
- 4
- 5
点击按钮即可在div中添加new.html。
方法二:纯js方法。(亲测可用,推荐此方法)
- 1
- 2
- 3
- 1
方法三:iframe 方法(未测试)
- 1
- 2
- 3
- 4
- 5
主页面为main.html,点击在div添加html按钮id为btn,
div的id为viewDiv,要插入的本地html为new.html。
方法一:基于Jquery的DIV嵌套html(测试可用)
点击按钮即可在div中添加new.html。
方法二:纯js方法。(亲测可用,推荐此方法)
方法三:iframe 方法(未测试)