我在下面顯示的代碼只是示例,不工作,以查看您是否可以幫助實現目標命名約定。我似乎無法看到 瞭解你如何命名目標。實際的代碼很好地在頁面上創建了一個tabset,我試圖做的只有 給定選項卡上的click事件打開了與所選標籤對應的tab頁中所需的URL。看起來好像 這麼簡單,但是我沒有試過目標(包括_parent,_self等)的作品,我找不到任何有關 命名約定如何用於文檔中特定目標位置的示例。open.window的目標名稱是tabpage_1?
<!DOCTYPE html>
<html>
<head>
<title>Networks</title>
<script>
function open_tp1()
{
window.open("http://www.ficticious1.com","#tabpage_1") //What is the target name to use insead of #tabpage_1
}
function open_tp2()
{
window.open("http://www.ficticious2.com","#tabpage_2") //What is the target name to use insead of #tabpage_2
}
</script>
</head>
<body>
<script src="tabs-soc.js"></script>
<form id="form1" name="form1">
<div id="wrapper" style="width: 934px">
<div id="tabContainer" style="width: 903px">
<div id="tabs">
<ul>
<li id="tabHeader_1">
<img src="image1.png" alt="Image1" onclick="open_tp1()" /></li>
<li id="tabHeader_2">
<img src="image2.png" alt="Image2" onclick="open_tp2()" /></li>
</ul>
</div>
<div id="tabscontent">
<div class="tabpage" id="tabpage_1">
</div>
<div class="tabpage" id="tabpage_2">
</div>
</div>
</div>
</div>
</form>
</body>
</html>
這不是'window.open'的工作方式。你可能想要一個iframe。 – SLaks
很難確定你的意思是「標籤」。顯然你的意思是「div」?瀏覽器選項卡不是出現在HTML頁面中的東西。 – LarsH