這是我直接從phpmyadmin裡面的寫法抓出來的
你可以參考看看
複製程式
<!--head 裡-->
<script language="JavaScript">
function confirmLink(theLink, theSqlQuery)
{
// Confirmation is not required in the configuration file
// or browser is Opera (crappy js implementation)
if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
return true;
}
var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery);
if (is_confirmed) {
theLink.href += '&is_js_confirmed=1'
}
return is_confirmed;
}
var confirmMsg = '您確定要 '
</script>
<!--body 裡-->
<A href="#" onClick="return confirmLink(this, 'DELETE FROM `addressbook`')">delete</a>