Zapomniałem, że tam jest link

Kod
<a href="messages.php?mode=delete&id=11"><img onclick="if(event)event.preventDefault();else window.event.returnValue=false;if(window.confirm('Napewno chcesz usunąc?')) window.location=this.parentNode.href;" border="0" src="../grafika/delete_msg.gif" alt="x" title="Usuń" /></a>
W sumie to lepiej będzie to dać do funkcji, bo zrobił się spory kod
Kod
<script type="text/javascript">
function _delete(e,a) {
if(e)e.preventDefault();
else window.event.returnValue=false;
if(window.confirm('Napewno chcesz usunąc?')) window.location=a.parentNode.href;
}
</script>
<a href="messages.php?mode=delete&id=11"><img onclick="_delete(event,this);" border="0" src="../grafika/delete_msg.gif" alt="x" title="Usuń" /></a>
Można to zrobić bez drugiego atrybutu this, ale to tylko by wydłużyło funkcję. Tak starczy