admin管理员组

文章数量:1318335

Want to make a confirm box appear before someone leave my site. They have information that will go lost if they leave and you don´t want that right. Pleas be specific with were I should put the code and so since I´m not the best of coders...

Want to make a confirm box appear before someone leave my site. They have information that will go lost if they leave and you don´t want that right. Pleas be specific with were I should put the code and so since I´m not the best of coders...

Share Improve this question asked May 12, 2012 at 18:51 XwequeXweque 6431 gold badge9 silver badges29 bronze badges 1
  • possible duplicate of Warn user before leaving page with unsaved changes -- please use the search before you ask a new question. – Felix Kling Commented May 12, 2012 at 18:56
Add a ment  | 

1 Answer 1

Reset to default 7
window.onbeforeunload = function(){
    return "Are you sure you wanna leave my site?";
}

本文标签: javascriptConfirm message before leaving site cross browser (JS)Stack Overflow