只要设置链接的target="frame的名字"  就好了吧不需要用js 
如果是要换frame 的里面的链接内容
就用
window.frames["id"].src
或者直接 window.framename.src

解决方案 »

  1.   

    <table align="center" width="845" height="950"  border="0" cellpadding="0" cellspacing="0">
      <tr> 
        <td  background="images/08_03_02.jpg" align="center" valign="middle" nowrap id="frmTitle" name="frmTitle" style="width: 160px"> 
          <iframe id="BoardTitle" name="main" style=" height: 100%; width:160; VISIBILITY: inherit; Z-INDEX: 2" scrolling="no" frameborder="0" src="lefttree.aspx"></iframe> 
        </td>
        <td align="center" background="images/b3.gif" style="width: 12px"> 
          <table width="7" height="64" border="0" cellpadding="0" cellspacing="0">
            <tr valign="middle"> 
              <td valign="middle" background="images/b8.gif" onclick="switchSysBar()" style="width: 8px"><span class="navPoint" id="switchPoint" title="关闭/打开 菜单">3</span> 
              </td>
            </tr>
          </table>
        </td>
        <td> 
          <iframe id="frmright" name="frmright" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1" scrolling="no" frameborder="0" src="szaic.aspx"></iframe> 
        </td>
      </tr>
      
    </table>客户端运行时动态改变frmright的SRC,是要动态呀
      

  2.   

    <a href="要显示的网页名字" target="右边frame的名字">显示</a>
      

  3.   

    document.getElementById("frmright").src="http://www.doulaicha.com";
      

  4.   


    //在topframe 下
    //js
    window.frame.frmright.src="url";
    window.frames["frmright"].src
    子frame
    window.parent.frame.frmright.src=...;
    或者是 window.parent.frames["frmright"].src
      

  5.   

    在HTML中,IFRAME的属性用SRC,但在JS中,只有部份浏览器支持修改SRC(读是没问题),真正通用的是要修改对应框架的href值。
    所以楼上对应switchSysBar()应该这样写:function switchSysBar()
    {
     window.frames["frmright"].location.href="action(或你需要的名字).aspx"
    }
      

  6.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    左边页面 代码
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>left</title>
    <script type="text/jscript">
    function opens(url){
      parent.document.getElementById("main").src=url;
      }
    </script>
    </head><body><ul>
    <li  onclick="opens('http://www.163.com')" >163.com</li>
    <li  onclick="opens('http://www.sina.com')" >sina.com</li>
    <li  onclick="opens('http://www.csdn.net')" >csdn.net</li>
     </ul>
    </body>
    </html>主页代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>主页</title>
    </head>
    <body>
    <table width="100%" border="1" cellspacing="0" cellpadding="0">
      <tr>
        <td width="200" >
       <iframe src="left.html" width="180" ></iframe> 
     </td>
        <td><iframe src="" id="main" width="100%" height="400" ></iframe></td>
      </tr>
    </table>
    </body>
    </html>
      

  7.   


    不知道 lz 是到底要换 frame 的src 还是链接的src 如果是连接的src 就是 我引用他这样写的
      

  8.   

     <td  background="images/menu_bg.gif" colspan="3" style="height: 18px">
    <asp:ImageButton ID="ImageButton3" runat="server" Height="25px" Width="73px" ImageUrl="~/images/p1.jpg"
     OnClientClick="test()" />
    现在在服务端有这样一个按钮,我的意思是点击这按钮动态改变frmright的SRC,用response.write();可不可以实现,或者用脚本也行
            
      

  9.   


    <asp:ImageButton ID="ImageButton3" runat="server" Height="25px" Width="73px" ImageUrl="~/images/p1.jpg" 
    OnClientClick="test()" /> <!--服务器端控件按钮-->
    <table align="center" width="845" height="950"  border="0" cellpadding="0" cellspacing="0"> 
      <tr> 
        <td  background="images/08_03_02.jpg" align="center" valign="middle" nowrap id="frmTitle" name="frmTitle" style="width: 160px"> 
          <iframe id="BoardTitle" name="main" style=" height: 100%; width:160; VISIBILITY: inherit; Z-INDEX: 2" scrolling="no" frameborder="0" src="lefttree.aspx"> </iframe> 
        </td> 
        <td align="center" background="images/b3.gif" style="width: 12px"> 
          <table width="7" height="64" border="0" cellpadding="0" cellspacing="0"> 
            <tr valign="middle"> 
              <td valign="middle" background="images/b8.gif" onclick="switchSysBar()" style="width: 8px"> <span class="navPoint" id="switchPoint" title="关闭/打开 菜单">3 </span> 
              </td> 
            </tr> 
          </table> 
        </td> 
        <td> 
          <iframe id="frmright" name="frmright" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1" scrolling="no" frameborder="0" src="szaic.aspx"> </iframe> 
        </td> 
      </tr> 
      
    </table> 
    上面有一按钮服务器端的,点击时在frmright里面打开新的页面
      

  10.   

    经过测试,一下代码可用:
    window.frames['framename'].location.href = "http://www.baidu.com";
      

  11.   

    window.frames['frameId'].location.href = "http://www.baidu.com";
    这样是不行的
      

  12.   

    大哥们,他说的是iframe 不是  frame好不! 
      

  13.   

    不知这位是什么html的代码里面测试通过的了?
    我现在需要改变iframe的src,上面的方法都没有用,不知哪位大侠可以指点一下了?
      

  14.   

    的确,我也在也遇到同样的问题。在主页上有一个Iframe,ID="Iframe1"在主页上引用了一个JS,Iframex.js,在主页上做了三个按钮:bt1,bt2,bt3.分别对应三个网页,bt1.aspx,bt2.aspx,bt3.aspx.代码:主页面上:<div id="xx1"><iframe id="Iframe1" scr="bt1.aspx" width="250" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe> </div>
    <div id="Left_select" align="center" style="width:230">
       &nbsp<input type="button" id="bt1" class="button2" value="BT1" title="" onclick="bt_click('bt1');"/>
               &nbsp<input type="button" id="ButtonOnline" class="button2" value="BT2" title="" onclick="bt_click('bt2');"/>
               &nbsp<input type="button" id="ButtonOffline" class="button2" value="BT3" title="" onclick="bt_click('bt3');"/>
        </div>
    在Iframex.js中添加代码:
    function bt_click(id)
    {
      switch(id)
      {
        case "bt1":
                document.getElementById("Iframe1").scr='bt1.aspx';
                break;
        case "bt2":
                document.getElementById("Iframe1").scr='bt2.aspx';
                break;
        case "bt3":
                document.getElementById("Iframe1").scr='bt3.aspx';
                break;
      }
    }点击按钮,Iframe1没有任何反应。哪位朋友能给点提示,谢谢!!