最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Confirm message before leaving site cross browser (JS) - Stack Overflow

programmeradmin3浏览0评论

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?";
}
发布评论

评论列表(0)

  1. 暂无评论