(转)用javascript做删除时的提示信息

第一种

function deleteRecord(theId)
{
 if(!confirm("您确定要删除该条记录吗?"))
 {
  return ;
 }
 document.location.href="delete.do?id="+theId;

 

<a href="javascript:deleteRecord(<bean:write name="news" property="id"/>)">删除</a>

 

第二种

<a href="delete.do?id=1" onclick="return confirm('确定删除?');">删除</a>

原文地址:https://www.cnblogs.com/toge/p/6114686.html