求解:javascript导致页面跳出iframe

lj10 2007-01-12 05:37:24
现页面在iframe中打开,通过以下javascript取复选框checked值传递到另一ASP页面完成删除操作:
function del(){
  var flag=true;
  var temp="";
  var tmp;
  if((document.form1.answer.length+"")=="undefined") {
tmp=1
}
else{
tmp=document.form1.answer.length
}
  if (tmp==1) {
   if (document.form1.answer.checked) {
   flag=false;
   temp=document.form1.answer.value
   }
  }
else {
   for (i=0;i<document.form1.answer.length;i++) {
   if (document.form1.answer[i].checked)
{
   if (temp=="") {
   flag=false;
   temp=document.form1.answer[i].value
   }
else {
   flag=false;
   temp = temp +","+ document.form1.answer[i].value
   }
   }
   }
  }
  if (flag){
alert("对不起,你还没有选择!");
}
  else {
name=document.form1.name.value
   if (confirm("确实要删除?")) {
   window.location="xwjl_del.asp?id=" + temp;
   }
  }
  return !flag;
}
</script>

===============================================

操作成功后导致在主界面打开连接都跳出iframe.
求该问题解决方法.

先谢谢了~
...全文
388 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
lj10 2007-01-29
  • 打赏
  • 举报
回复
虽然问题没有解决,但是还是谢谢以上朋友的解答.结帖
showlin 2007-01-15
  • 打赏
  • 举报
回复

location="xwjl_del.asp?id=" + temp;
selft.location="xwjl_del.asp?id=" + temp;
都可以

但请先检查xwjl_del.asp页面中没有跳出frame的操作
有时候,错误表现的地方并不一定是错误产生的地方
lj10 2007-01-15
  • 打赏
  • 举报
回复
to nihaopp() :
首先感谢解答;
但是试后,问题仍没有解决.
lj10 2007-01-13
  • 打赏
  • 举报
回复
顶一下...
nihaopp 2007-01-13
  • 打赏
  • 举报
回复
1.在form1加上target="_self"试试;
2.
在第一个页面插<iframe frameborder="0" width="0" height="0" scrolling="no" src="about:blank" id="userdelimg" name="userdelimg"></iframe>然后在form1加上target="userdelimg";
3.暂时和第二一样@)
lj10 2007-01-13
  • 打赏
  • 举报
回复
顶,求解...
lj10 2007-01-12
  • 打赏
  • 举报
回复
self.location也试过,无效。
  • 打赏
  • 举报
回复
self.location

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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