<input type="button" value="Delete" onclick=show_confirm(http://mydomain.com/delete.php)>
I have this button and this JavaScript function, but they don’t work.
When I click the button, nothing happens.
What is wrong with my code?
function show_confirm(url){
var r = confirm("Do you want to delete this?");
if (r == true){
window.navigate(url);
}
else{
alert("You pressed Cancel.");
}
}
1 Answer