iframe应该有自己的id(比如是iframe1),在主界面里设置iframe1的属性即可,document.getElementById("iframe1").src = "http://www.baidu.com";

解决方案 »

  1.   

    IFRAME里面的超链接这么写:
    <a href="http://www.baidu.com" target="_top">打开</a>
      

  2.   

    那<a href="javascript:abc(1);" target="_top">打开</a>
    然后在脚本里面用document.form.action="http://www.baidu.com"这样好像就不行,应该怎么办?
      

  3.   

    楼上的是什么意思??
    document.form.target="_top";
    document.form.action="http://www.baidu.com";
      

  4.   

    document.form.target="_top";
    document.form.action="http://www.baidu.com";
    好像不行呢
      

  5.   

    document.form.target="_top";会去掉框架呢,有没有不去掉框架父窗口刷新的??我用脚本生成一个框架也不行
      

  6.   

    那你试一下"_parent"看看呵呵试过了,也不行,window.loaction.src这些都试过了,都不行
      

  7.   

    最好是用_top作为顶层
    _parent是父层如果框架有几层的话,就一定要用_top
      

  8.   

    <form id="form1" name="form1">
    ...
    </form><a href="javascript:aaa();">提交</a>
    <script>
    function aaa()
    {
    var frm = document.forms["form1"];
    frm.target = "_top";
    frm.action = "xxx.asp";
    frm.submit();
    }
    </script>
      

  9.   

    <a href="URL" target="_top">文字</a>