summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blog.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/blog.c b/blog.c
index 73c0ff1..2ecfa1f 100644
--- a/blog.c
+++ b/blog.c
@@ -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>");