日期:2014-05-18  浏览次数:20619 次

js大虾请留步: top对象如何实现在A框架中点击某链接,而在B框架中显示链接的内容!
主页面mainIndex.htm:
<FRAMESET border=0 name=apptop frameSpacing=0 rows=50,24,*,22 frameBorder=0>
<FRAME name=topFrame src="index.files/top.htm" noResize scrolling=no>
<FRAME name=midFrame src="index.files/mid.htm" noResize scrolling=no target="main">

  <FRAMESET border=0 name=content frameSpacing=0 frameBorder=0 cols=140,*>
  <FRAME name=menu src="index.files/menu.htm" 
  frameBorder=no scrolling=no target="main">
  <FRAME name=main src="index.files/index.htm" 
  frameBorder=no scrolling=yes target="_self">
  </FRAMESET>
<FRAME name=bottom src="index.files/version.htm" noResize scrolling=no>

</FRAMESET>

A:在子框架menu.htm中:
  <TR>
  <TD style="PADDING-LEFT: 20px" bgColor=#b9dcf3 height=21>- <A id=m0 
  onclick="top.main.location.replace('URL');[color=#00CCFF][/color]current_menu(2)" //这里的URL到底是何意?location.replace()??? href="http://localhost:8080/BOM/index.files/new.htm" >点击链接</A></TD></TR>
  //此链接的页面new.htm是要取代下面框架的页面index.htm
   
B:子框架index.htm中:
  <TR>
  <TD align=middle></TD>
  <TD align=middle><FONT face="Courier New"> 
  旧页面</A></FONT>
  <TD align=middle></TD>
  </TR>





------解决方案--------------------
top的意思是上一个框架,
main是某框架中的一个帧(即某个frame的名字),
location为是什么要放到这里边,(可能为jsp.html文件等),
replace为把前面的js对象替换掉(这里替换的是top.main.location).

------解决方案--------------------
结帖率:0.00%,你结贴率太低了,该结结贴了.........就算为了以后.........