Protect Textarea

By arantius Last update Aug 10, 2011 — Installed 1,719 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 3 posts, 3 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
jeroenvrp User

This script doesn't work in Firefox 2 as it seems. I tested it with Wikipedia and a Joomla site. When I close the tab, there is no warning.

 
ankut Scriptwright
Just a comment regarding your question... the reason your addEventListener didnt work, is that you have to put the entire function body into that second argument of addEventListener. Putting a reference to your function will not work since it will go out of scope!

window.addEventListener('beforeunload', function(event){...}, true);

Just like that, and it should be fine.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel