首页 > 如何能实现不刷新的在页面嵌入页面

如何能实现不刷新的在页面嵌入页面

当我点击左边的侧栏的时候,我能在预留窗口中看到无刷新的页面显示,用js可以实现不。


Not sure what you mean. If "预留窗口" is referring to a <iframe>:

Updating DOM in an <iframe> is possible, you can acquire the document object of the frame using
iframeElement.contentDocument || iframeElement.contentWindow.document, then modify it. You can also call functions defined inside <iframe> using iframeElement.contentWindow directly.

Notice you'll need to follow same-origin policy in order to do so.


可以的。
AngularJs之类的MVVM框架就是这么玩儿的。模版通过ajax请求过来,js渲染到DOM里。

【热门文章】
【热门文章】