Last active
January 23, 2021 18:57
-
-
Save davidoster/3dbf69b875b1db400c95c923136ae96e to your computer and use it in GitHub Desktop.
Playing around
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<HTML> | |
<HEAD></HEAD> | |
<BODY> | |
<!-- doesn't work!!! <a href="" onclick='onDelete("http://localhost:3000/books/delete/1")'> Delete</a> --> | |
<button onclick='onDelete("http://localhost:3000/books/delete/1")'> Delete</button> | |
<SCRIPT> | |
function onDelete(url) { | |
var dialog = confirm("Are you sure you want to delete this book?"); | |
if(dialog) { | |
console.log("ok"); | |
//window.location.replace("https://in.gr"); | |
window.location.replace(url); | |
} else console.log("nok"); | |
} | |
</SCRIPT> | |
</BODY> | |
</HTML> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment