onClick无效在框架中如何设置,如下框 ,右框架
这个链接在上框中 ,在下框打开新页index2.asp<a   href="javascript:show(0);" onClick="window.location.href= 'index2.asp';   return false;" >进入</a >                    
<FRAME name=down ......

解决方案 »

  1.   

    <a   href="javascript:show(0);" onClick="document.getElementById('frame1').location.href=  'index2.asp ';>进入 </a  >                     
    <FRAME id="frame1" name=down ......
      

  2.   

    楼上的谢谢了,掉了个 引号 "还是不行呀,大家帮我调一下
    top.htm
    <a   href="javascript:show(0);" onClick="document.getElementById( 'frame1').location.href='index2.htm'; ">进入  </a>                      fram.htm
    <HTML>
    <HEAD>
    <TITLE>Untitled Document</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"> 
    </HEAD>
    <FRAMESET ROWS="80,*" FRAMEBORDER="NO" BORDER="0" FRAMESPACING="0"> 
    <FRAME NAME="topFrame" SCROLLING="NO" noresize SRC="top.htm" > 
    <FRAME id="frame1" NAME="mainFrame" SRC="no1.htm"> 
    </FRAMESET><NOFRAMES> 
    <BODY BGCOLOR="#FFFFFF"></BODY></NOFRAMES>
    </HTML>no1.htm
    no1页面index2.htm
    index2页面
      

  3.   

    top.htm
    <a   href="index2.htm"  target="mainFrame" >进入   </a >  直接设置链接的框架对象不就得了,有这么麻烦吗,还用js控制. 
      

  4.   

    top.htm 
    <a href='#'  onclick="parent.document.getElementById('frame1').src= 'index2.htm'" >进入   </a >    你那个show()函数没定义还是什么的,删除了.                   
      

  5.   

     大哥们测试一下,不行
    我把框架代码列出来,就是方便在家调试,copy一下
      

  6.   

    我测试过了,没问题啊.我是ie6.0的,你的不会是ff的吧?frame.htm
    <HTML > 
    <HEAD > 
    <TITLE >Untitled Document </TITLE >  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312" >  
    </HEAD > 
    <FRAMESET ROWS="80,*" FRAMEBORDER="NO" BORDER="0" FRAMESPACING="0" >  
    <FRAME NAME="topFrame" SCROLLING="NO" noresize SRC="top.htm"  >  
    <FRAME id="frame1" NAME="mainFrame" SRC="no1.htm" >  
    </FRAMESET > <NOFRAMES >  
    <BODY BGCOLOR="#FFFFFF" > </BODY > </NOFRAMES > 
    </HTML > index2.htm 
    index2.htm 
    top.htm
    <HTML > 
    <HEAD > 
    <TITLE >Untitled Document </TITLE >  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312" >  
    </HEAD > 
     
    <BODY BGCOLOR="#FFFFFF" > 
    <a href='#'  onclick="parent.document.getElementById('frame1').src= 'index2.htm'" >进入   </a >  
    </BODY > 
    </HTML > 
      

  7.   

    直接走document.location="index2.htm"不就行了么...
      

  8.   

    onclick="document.location='index2.htm'"
      

  9.   

    如果fram.htm 这个框架页的上一层  是一个框架怎么写onClick="window.location即default.htm(也是框架页) 
    <FRAME name=index_member src="/admin/fram.htm">