2011-08-23 124 views
1

在IE8上随同一系列链接一起下拉一个链接以及Open directlyNextPrevious按钮。在同一个窗口中打开框架内的链接

var count = -1 
var total = 24 

function goToNext() 
{ 
count = parent.nav.openfile.file.selectedIndex 
count ++ 
if (count > total) 
count = 0; 
    parent.display.location= parent.nav.openfile.file.options[count].value 
    parent.nav.openfile.file.selectedIndex = count 
} 

function goToPrevious() 
{ 
    count = parent.nav.openfile.file.selectedIndex 
    count -- 
    if (count < 0) 
count = total; 
    parent.display.location=parent.nav.openfile.file.options[count].value 
    parent.nav.openfile.file.selectedIndex = count 
} 

function LoadFirst() 
{ 
parent.display.location=parent.nav.openfile.file.options[0].value 
} 


function OpenDirectly() 
{ 
    parent.display.location = parent.nav.openfile.file.options[parent.nav.openfile.file.selectedIndex ].value 
} 
<FRAMESET ROWS="45,*"> 
<FRAME 
BORDER="1" 
FRAMEBORDER="YES" 
MARGINHEIGHT="10" 
MARGINWIDTH="10" 
NAME="nav" 
SCROLLING="NO" 
SRC="/Slide/test.jsp" 
/> 
<FRAME 
    BORDER="1" 
    FRAMEBORDER="YES" 
    MARGINHEIGHT="10" 
    MARGINWIDTH="10" 
    NAME="display" 
    ID="display" 
    SCROLLING="AUTO" 
    SRC="/page.html" 
/> 
</FRAMESET> 

以上是代码(test.jsp的后跟包含主框架和导航框架的HTML代码 - 导航框架是导航和在其内的所有链路就应该在主框架内打开)通过点击这些按钮来向前移动,之前或直接加载。问题是这些链接在新窗口或新标签中打开,但从不在同一个窗口中。如果有人提供相同的建议,我将非常感激。

+0

你为什么使用家长? – Drazisil

+0

请检查更新后的帖子。 –

+0

是否有任何特定的原因,你宁愿老式''元素在服务器端包括像'''? – BalusC

回答

1

在导航页面的每个链接上,您需要添加display框架的目标,或者更好地将<base target="display">添加到test.jsp的首部。目标决定在哪里打开链接。

相关问题