Javascript 如何在iframe中编辑时自动更改Html页面的内容

Javascript 如何在iframe中编辑时自动更改Html页面的内容,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我已经创建了一个动态html页面,并通过单击文本编辑器中的“打开动态html页面的内容”在home.html页面中打开它。在文本编辑器中编辑内容时,我希望这些更改自动显示在动态html页面中 我已经创建了动态html页面内容 <h1>This is my first content</h1> <h2>This is my first content</h2> <h3>This is my first content</h3>

我已经创建了一个动态html页面,并通过单击文本编辑器中的“打开动态html页面的内容”在home.html页面中打开它。在文本编辑器中编辑内容时,我希望这些更改自动显示在动态html页面中

我已经创建了动态html页面内容

<h1>This is my first content</h1>
<h2>This is my first content</h2>
<h3>This is my first content</h3>
<h4>This is my first content</h4>
<h5>This is my first content</h5> 
这是我的第一个内容
这是我的第一个内容
这是我的第一个内容
这是我的第一个内容
这是我的第一个内容
我在home.html中打开了

$(function () {
    load_home();
});
function load_home() {
     document.getElementById("content").innerHTML='<object style="width:100%; height:1000px; overflow-y:hidden;" type="text/html" data="Responce.html" ></object>';
}
$(函数(){
加载_home();
});
函数加载_home(){
document.getElementById(“内容”).innerHTML='';
}
我通过点击编辑按钮打开了iframe中的内容

<iframe id="texteditor" src="Responce.html" name="texteditor" style="width: 100%; height: 74%;"></iframe>


在文本编辑器中编辑内容时,我希望更改自动显示在动态html页面中。

您可以使用location对象重定向到JS中的页面:

window.location.href = "/redirect.html";
不知道你的第二句话是什么意思,重定向到一个页面意味着你要重定向的页面被卸载

如果您只想打开一个窗口并在其中写入一些文本而不重定向任何内容,您可以使用window.open:

var myWindow = window.open();
myWindow.document.write("<your text>");
var myWindow=window.open();
myWindow.document.write(“”);

我们应该编码吗?首先:如果你想要所有的代码,也许你想雇佣一个可能重复的人。这可能是您的问题的可能解决方案。您好,欢迎来到Stack Overflow,请花时间阅读和。