html
javascript
aa
<a href="delete.php?id=22" onclick="return confirm('Are you sure?')">Link</a><script>
function hps(id){
  if (window.confirm('Yakin akan menghapus?'))
  {
    $.post("",{hps:id} ).done(function(response){
      var wnd = window.open("about:blank", "", "_blank")
      wnd.document.write(response)
      //var node = response.split("<<<")
      //if(node[1]==" ok "){location.reload(true)}
    })  
  }else{
      // They clicked no
  }
}
</script>
html
javascript
<a href="delete.php?id=22" onclick="return confirm('Are you sure?')">Link</a><button onclick="if(confirm('Are you sure?')) saveandsubmit(event)"></button>
atau
<button onclick="return confirm('Are you sure?')?saveandsubmit(event):''"></button>
Komentar