add html5 events-->beforeunload