Best practice: attach beforeunload only after the user changes something, or remove the listener when they save.
beforeunload
Lines: 0 | Characters: 0