<a title='delete this comment' href='javascript:DelComment(40);' target='_blank'>Delete</a>
我可以把手 按在 圣经上 发誓,DelComment 这个 方法 存在的。点击这个超链接后,ie 6 下 开了一个 新窗口,地址栏 出现ff 下 出现 DelComment is not defined为什么呢?改为 :<a title='delete this comment' href='#' onclick="javascript:DelComment(40);" target='_blank'>Delete</a> 或者<a title='delete this comment' href='javascript:;' onclick="javascript:DelComment(40);" target='_blank'>Delete</a>倒是弹出 对话框了,删除程序也执行了,但是弹出 一个 新窗口。大侠 们 遇到过这种怪问题吗?指点迷津呀function DelComment(id)
{
if(confirm("Delete this comment,are you sure?"))
{
getstatu("<span style='color:red'>deleting.....</span>");
$.ajax(
{
type:"GET",
url:'GetCommentById.ashx?ctype=delete&cid='+id,
success:function(return_data){getstatu(return_data);},
error:function(){getstatu("<span style='color:red'>Errors occur just now,please try again......</span>");}
}
);
$("#client_html_comment_list_"+id).hide();
}
//return false;
}
我可以把手 按在 圣经上 发誓,DelComment 这个 方法 存在的。点击这个超链接后,ie 6 下 开了一个 新窗口,地址栏 出现ff 下 出现 DelComment is not defined为什么呢?改为 :<a title='delete this comment' href='#' onclick="javascript:DelComment(40);" target='_blank'>Delete</a> 或者<a title='delete this comment' href='javascript:;' onclick="javascript:DelComment(40);" target='_blank'>Delete</a>倒是弹出 对话框了,删除程序也执行了,但是弹出 一个 新窗口。大侠 们 遇到过这种怪问题吗?指点迷津呀function DelComment(id)
{
if(confirm("Delete this comment,are you sure?"))
{
getstatu("<span style='color:red'>deleting.....</span>");
$.ajax(
{
type:"GET",
url:'GetCommentById.ashx?ctype=delete&cid='+id,
success:function(return_data){getstatu(return_data);},
error:function(){getstatu("<span style='color:red'>Errors occur just now,please try again......</span>");}
}
);
$("#client_html_comment_list_"+id).hide();
}
//return false;
}
用href="javascript: return DelComment(40);"加上把return打开才能不开新窗口.第二,DelComment is not defined
不一定是DelComment这个方法的错误.
有可能是其他地方的花括号没对齐.
发个完整代码才有可能找到.