简体   繁体   English

用另一个 DOM 完全替换 HTML DOM

[英]Replace the HTML DOM completely with another DOM

I want to replace a HTML document in the browser with another HTML document or another DOM without changing the document.location .我想用另一个 HTML 文档或另一个 DOM 替换浏览器中的 HTML 文档而不更改document.location

Possible with JavaScript? JavaScript 可能吗?

No you can't change a Window's document property by any other means than navigation (in case of an open ed Window or an <iframe> 's one from about:blank ).不,您不能通过导航以外的任何其他方式更改窗口的document属性(如果是open ed Window 或<iframe>来自about:blank的一个)。

https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM