-1
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 first code I’m trying to show a confirm
on screen to ask if really the user will want to delete that news.
In the 2nd code there is a link with a onclick
for the Javascript function.
The problem is this by clicking on the delete link it just doesn’t show the confirmation window or anything, it’s like there’s no link at all.
Add the code in text, can not simulate the problem in a code of an image, easy to have the same in text.
– user28595
Quiet ! Thank you for the tip
– Ikaro Sales