Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/472.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在同一窗口中打开框架内的链接_Javascript_Html_Internet Explorer 8_Frame - Fatal编程技术网

Javascript 在同一窗口中打开框架内的链接

Javascript 在同一窗口中打开框架内的链接,javascript,html,internet-explorer-8,frame,Javascript,Html,Internet Explorer 8,Frame,在IE8上有一个包含大量链接的下拉列表,其中包括直接打开、下一个和上一个按钮 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[cou

在IE8上有一个包含大量链接的下拉列表,其中包括
直接打开
下一个
上一个
按钮

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
}
var count=-1
var总计=24
函数goToNext()
{
count=parent.nav.openfile.file.selectedIndex
计数++
如果(计数>总数)
计数=0;
parent.display.location=parent.nav.openfile.file.options[count].value
parent.nav.openfile.file.selectedIndex=计数
}
函数goToPrevious()
{
count=parent.nav.openfile.file.selectedIndex
计数--
如果(计数<0)
计数=总数;
parent.display.location=parent.nav.openfile.file.options[count].value
parent.nav.openfile.file.selectedIndex=计数
}
函数LoadFirst()
{
parent.display.location=parent.nav.openfile.file.options[0]。值
}
函数opendirective()
{
parent.display.location=parent.nav.openfile.file.options[parent.nav.openfile.file.selectedIndex].value
}


上面是代码(test.jsp,后面是包含主框架和导航框架的HTML代码-导航框架是导航,其中的所有链接都应该在主框架内打开),单击这些按钮可以调用这些代码向前移动、上一步或直接加载。问题是这些链接在新窗口或新选项卡中打开,但从不在同一窗口中打开。如果有人能提供相关建议,我们将不胜感激。

在导航页面的每个链接上,您需要添加
显示
框架的目标,或者最好将
添加到
test.jsp
的标题部分。目标决定在何处打开链接。

在导航页面的每个链接上,您需要添加
显示
框架的目标,或者最好将
添加到
test.jsp
的标题部分。目标用户决定在何处打开链接。

请查看更新后的帖子。是否有任何具体原因使您更喜欢老式的
元素而不是服务器端的包含内容,如
?除了代码是在旧时代编写的,并且我的任务是在相同的时间打开框架之外,没有其他具体原因好的,我假设您想坚持使用HTML
的东西。这使它成为一个HTML/JS问题,而不是JSP问题。我编辑标签是为了吸引合适的人。当然+1.想知道这是否是一个jsp问题,如何处理?请查看更新后的帖子。是否有任何具体原因使您更喜欢老式的
元素而不是服务器端包含的元素,如
?没有具体原因,除了代码是在旧时代编写的,并且任务是在同一窗口中打开框架。好的,我假设您希望坚持使用HTML
这件事。这使它成为一个HTML/JS问题,而不是JSP问题。我编辑标签是为了吸引合适的人。当然+1.想知道这是否是一个jsp问题,人们会如何处理它?
<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>