diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-08-13 19:55:29 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-08-13 19:55:29 -0400 |
commit | ac5e89a94407187de715bfca7c1c8956ef0997f6 (patch) | |
tree | 2c0041bfe3cfcdd0e50ed29141a8d46e71f34cb3 | |
parent | 1dc7d97614817f4c4f9f9aba43d2967aedec59d7 (diff) |
prevent accidental navigation away
-rw-r--r-- | blog.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -151,6 +151,9 @@ int main(void) puts("<script type=\"text/javascript\">"); puts("function update() {"); puts("\tdocument.getElementById(\"output\").innerHTML = document.getElementById(\"body\").value;"); + puts("\twindow.onbeforeunload = function() {"); + puts("\t\treturn 'Are you sure you want to leave?';"); + puts("\t}"); puts("}"); puts("</script>"); |