Home > front end >  Js listen close browser triggers, different from the refresh and jump
Js listen close browser triggers, different from the refresh and jump

Time:01-20

Looked for a lot of methods are useless, jump or refresh when triggered, not only by closing the browser or close the page to trigger for the great spirit action

CodePudding user response:

Now there is no perfect closed, refresh and jump method,
Don't put your business logic on the page,

CodePudding user response:

What browser are you using? With IE can run perfect, with firefox and Google, can only be triggered once, when the second page refresh, directly refresh, won't prompt

CodePudding user response:

Window. Onbeforeunload=function (event) {
//...
}
Closed or jump triggered, refresh does not trigger,,,

CodePudding user response:

Window. The onunload=function (event) {
//,,,
}
Same as above

CodePudding user response:

Refresh or triggers
  • Related