如果是直接访问导航文件
http://2010.020757.com/menu.htm 则能正常打开链接。。用iframe 方式把导航设为左框时,网址:http://2010.020757.com/ 问题:点击导航链接,出现错误,导航链接无效;
错误提示:错误提示:行170 Char 5 对象不支持此属性或方法。位置如下:function a(URL,id)
{
  set_current(id);
  if(URL.substr(0,7)!="http://" && URL.substr(0,6)!="ftp://")
  URL = "/html/"+URL;
  parent.openURL(URL,0);
}具体定位到 parent.openURL(URL,0); 这行.请帮忙看看,谢谢各位

解决方案 »

  1.   

    parent.openURL 可以让我看下这个方法嘛
      

  2.   

    parent.openURL方法<script type="text/javascript" >
    function openURL(strURL)
    {
    window.parent.open(strURL);
    }
    </script>
      

  3.   

    A的方法//-------- 打开网址 -------
    function a(URL,id)
    {
       set_current(id);
       if(URL.substr(0,7)!="http://" && URL.substr(0,6)!="ftp://")
          URL = "/produit/"+URL;
        parent.openURL(URL,0);
    }实际链接:代码<a href="javascript:a('ysall.asp','18');" id="f18"><span><img src="images/ico/2.gif" align="absMiddle"/> 
            每月费用</span></a>
      

  4.   

    好了问题找到了
    你调用的parent.openURL有误。
    可以考虑改为window.openURL
      

  5.   

    parent.openURL(URL,0);的意思是
    在本页面即menu.htm中调用它的父框架的js函数,
    之所以报脚本问题是因为在他的父框架中没有openURL函数。
    而你把openURL()放在menu.htm中就不对了。两种方法:
    1、parent.openURL的前缀去掉;
    2、把openURL()放入父框架中
      

  6.   

    非常感谢 cj205,dragonlong2..还有一个问题。想要在 <frame src="desk.htm" name='right' scrolling='yes' noresize='noresize' /> 的所在的 right 框架上打开,又怎样改写这个代码呢?达到效果就是替换desk.htm所在的页面
      

  7.   

    window.parent.frames[i].location = strURL;这个i代表你要指向的框架
      

  8.   

    前提是 menu,desk 这两个页面是在同一个框架中,而且是同级的
    window.parent.right.location.href= strURL;
    frame 标签的name属性的作用在于此
      

  9.   

    直接目标框架.location="目标网页"就可以了