这样的
我举个例子你就明白了
<input type="button" onClick=" ask = window.confirm("are you sure?"); if(ask) return true; else false;" >
这样就有了选取消不打开连接的效果
我举个例子你就明白了
<input type="button" onClick=" ask = window.confirm("are you sure?"); if(ask) return true; else false;" >
这样就有了选取消不打开连接的效果
解决方案 »
- jquery 弹出对话框被activex控件遮挡问题
- CKEDITOR.instances.body.setData(value),编辑器格式化复杂的html代码出错,谁能帮我解决下,万分感激
- 请教jquery高手,请问jquery中选择器的使用$('> div',this)
- 用js如何获取div的真实高度,包括margin和border?
- 请教定时提醒程序!!!谢谢大家帮忙!!!
- 怎样通过JS检测上传文件的扩展名符合要求(数组)
- 只允许输入阿拉伯数字,英文字母和中划线并且中划线不能放在开头,谁有办法?
- window.open 如何屏蔽弹出窗口的关闭"X"按钮?急,在线等待,
- 怎么实现?
- 哪里有javascript源代码方面的站点.
- 我想让一个文本匡只能输入数字才能提交
- 如何鼠标指到单元格中,把单元格中的文字颜色改变
最后那里应该是
else return false;
写漏了一个return ^^
echo "<script language='javascript'>\n";
echo "if(!window.confirm('确认吗?')){self.location='sort.php?flag=confirmed'}";
echo "</script>";
if($confirmed){
include("checklogin.php");
include("../connections/conn.php");
$sele = "delete from table where sort_id=$sort_id_dele";
$result = mysql_query($sele) or die(mysql_error());
}
?>
function conf()
{
if(confirm('确认吗'))
{
self.location="sort.php?flag=confirmed";
}
}
</script><input type=button onclick="return conf()"><?
if($flag=="confirmed"){
include("checklogin.php");
include("../connections/conn.php");
$sele = "delete from table where sort_id=$sort_id_dele";
$result = mysql_query($sele) or die(mysql_error());
}
?>