如果是直接访问导航文件
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); 这行.请帮忙看看,谢谢各位
function openURL(strURL)
{
window.parent.open(strURL);
}
</script>
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>
你调用的parent.openURL有误。
可以考虑改为window.openURL
在本页面即menu.htm中调用它的父框架的js函数,
之所以报脚本问题是因为在他的父框架中没有openURL函数。
而你把openURL()放在menu.htm中就不对了。两种方法:
1、parent.openURL的前缀去掉;
2、把openURL()放入父框架中
window.parent.right.location.href= strURL;
frame 标签的name属性的作用在于此