Javascript-js window Escape effect for advice

Source: Internet
Author: User
To do a background, edit the function of the article, product requirements, when the user click on the edit window to modify and not save, click anywhere outside the editing window to block the default event, pop-up window allows the user to choose whether to save and then execute the default event.
Think about it. There is no good solution, ask for a way of thinking.

The main problem is not to close the browser trigger box, but to click on the page of the non-editing window part of the trigger, and these parts have a variety of binding events, links and so on.

Reply content:

To do a background, edit the function of the article, product requirements, when the user click on the edit window to modify and not save, click anywhere outside the editing window to block the default event, pop-up window allows the user to choose whether to save and then execute the default event.
Think about it. There is no good solution, ask for a way of thinking.

The main problem is not to close the browser trigger box, but to click on the page of the non-editing window part of the trigger, and these parts have a variety of binding events, links and so on.

The original idea is to be able to add a lost focus event to the editing window, bounce out of the definition confirm, according to the choice of confirm to determine whether to execute the default event, the result is abandoned ...
Finally, you can only add a judgment method to each link and event, passing in the default execution function as the callback parameter
Like this

首页

Switch

    

确认离开?

是否首页

A very popular dialog box plugin,
Http://aui.github.io/artDialo ...

Listening for browser shutdown events

Is it okay to bind the onblur event to the editor?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.