![](/img/trans.png)
[英]How to open links in an iframe with target=“_blank” in the same iframe?
[英]Open multiple links in same Iframe
* 我試圖在同一個iframe中打開多個鏈接,以及更改divsstyle.visibility(可見性對我有用)但添加window.open我什么都沒得到。 我的原始地址在div id =“testing”name =“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>
window.open
打開一個彈出窗口。 它不會改變iframe
。 要在iframe
打開其他頁面,請考慮使用JQuery
更改iframe
的“ src
”屬性
另外,正如Collin Grady在評論中提到的那樣,在鏈接的“target”屬性中指定iframe id是一種更簡單的方法來完成這項工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.