请教各位javascript高手

garlic11 2001-11-21 05:52:30
我写了以下代码:
<script languague="javascript">
<!--begin
function top_click(ope){
if (ope == 'add'){
window.location.replace("System_management_top.jsp?operate=add");
window.parent.frames.item(1).location.replace("System_management_add.html");
window.parent.frames.item(2).location.replace("System_management_help.jsp?msg=helpAdd");
}else
if (ope == 'change'){
window.location.replace("System_management_top.jsp?operate=list");
window.parent.frames.item(1).location.replace("System_management_list.html");
window.parent.frames.item(2).location.replace("System_management_help.jsp?msg=helpList");
}
}
end-->
</script>

上面这个函数是用于根据用户点击的超连接,让不同的frame同时加载相应的页面,两个超连接如下:
<a href="javascript:top_click('add');"> New user</a>
<a href="javascript:top_click('change');">Change user infomation</a>

以上代码在ie里能正确执行,可在netscape中却不行,我想请问大侠,如何能让ie和netscape都能正确的执行上面的代码?
谢谢!
...全文
54 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
garlic11 2001-11-22
  • 打赏
  • 举报
回复
to CommerceServer 您介绍的方法好象不大对,不过还是谢谢您的热心帮助。
to karma 您的方法很有效,可能是因为netscape不认得item之类的东东吧,谢谢!
karma 2001-11-21
  • 打赏
  • 举报
回复
<script languague="javascript">
<!--
function top_click(ope){
if (ope == 'add'){
window.location.replace("System_management_top.jsp?operate=add");
window.parent.frames[1].location.replace("System_management_add.html");
window.parent.frames[2].location.replace("System_management_help.jsp?msg=helpAdd");
}else
if (ope == 'change'){
window.location.replace("System_management_top.jsp?operate=list");
window.parent.frames[1].location.replace("System_management_list.html");
window.parent.frames[2].location.replace("System_management_help.jsp?msg=helpList");
}
}
-->
</script>
CommerceServer 2001-11-21
  • 打赏
  • 举报
回复
将parent前面的window去掉
或parent.frame(1).location.href="System_management_list.html"

87,994

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧