1st Code :
$urlExclusao = "index.php?".PARAMETER_NAME_ACTION."=delete&";
$urlExclusao .= PARAMETER_NAME_FILE."=noticia";
$urlExclusao .= "&id=".$row->noticiaid;
$test = $urlExclusao;
echo "
<script type='text/javascript'>
function confirmation() {
var answer = confirm('Deseja excluir essa Noticia ?');
if (answer = true){
window.location.href = ". $test ";
}
}
</script>";
2nd Code :
<a onclick=\"confirmation()\"><img src=\"".DIR_ICONS."delete.png\" title=\"Excluir\" /></a>";
In the 1st code I'm trying to show a confirm
on the screen to ask if the user really wants to delete this news.
In the 2nd code you have a link with a onclick
for the JavaScript function.
The problem is the following when clicking the delete link it just does not show the confirmation window or anything, it's as if there was no link at all.