Javascript 在同一Iframe中打开多个链接

Javascript 在同一Iframe中打开多个链接,javascript,iframe,Javascript,Iframe,*我试图在同一个Iframe中打开多个链接,并更改divssstyle.visibility(visibility对我有效),但添加window.Open我一无所获。我在div id=“testing”name=“wordp”中有原始地址* 函数wordpaboutme(){ var showme2=document.getElementById(“测试”); showme2.style.visibility=“可见”; var changeme=document.getElementById

*我试图在同一个Iframe中打开多个链接,并更改divssstyle.visibility(visibility对我有效),但添加window.Open我一无所获。我在div id=“testing”name=“wordp”中有原始地址*


函数wordpaboutme(){
var showme2=document.getElementById(“测试”);
showme2.style.visibility=“可见”;
var changeme=document.getElementById(“测试”);
换衣服。窗户。打开。('http://mysite.com/main/about-me/","wordp",;
}


您的浏览器不支持iFrame。


窗口。打开
打开一个弹出窗口。它不会改变
iframe
中的内容。 要在<代码> iFrAME中打开一个不同的页面,考虑用“代码> jQuery < /代码>

更改iFrAME的“<代码> SRC < /代码>”属性。
此外,正如Collin Grady在评论中所提到的,在链接的“target”属性中指定iframe id是一种更简单的方法,可以完成这项工作。

此外,只需使用
target=“wordp”
<head>
    <script type="text/javascript">
                function wordpaboutme() {
                   var showme2 = document.getElementById("testing");
                    showme2.style.visibility = "visible";

                    var changeme = document.getElementById("testing");
                    changeme.window.open.('http://mysite.com/main/about-me/','wordp');  

                }
            </script>
<body>
    <div id="testing" name="wordp" class="bloger" ><iframe src="http://mysite.com/main/" frameborder="0" scrolling="no" width="990" height="800"  >
      <p>Your browser does not support iframes.</p> 
    </iframe>
    </div>