To create a background, edit the article function, and product requirements, when the user clicks the edit window and does not save the changes, click any place other than the edit window to prevent default events, the pop-up window allows you to select whether to save and then execute the default event. There is no good solution if you want to come and try again... to create a background, edit the article function, and product requirements, when the user clicks the edit window and does not save the changes, click any place other than the edit window to prevent default events, the pop-up window allows you to select whether to save and then execute the default event.
There is no good solution if you want to come and try again.
The main problem is not to close the browser trigger dialog box, but to trigger when you click the non-edit window part on the page, which contains various binding events, links, and so on.
Reply content:
To create a background, edit the article function, and product requirements, when the user clicks the edit window and does not save the changes, click any place other than the edit window to prevent default events, the pop-up window allows you to select whether to save and then execute the default event.
There is no good solution if you want to come and try again.
The main problem is not to close the browser trigger dialog box, but to trigger when you click the non-edit window part on the page, which contains various binding events, links, and so on.
The original idea was to add a defocus event to the editing window. the custom confirm was displayed. based on the choice of confirm, the default event was executed and the result was abandoned...
At last, you can only add judgment methods for each link and event, and pass in the default execution function as the callback parameter.
Similar to this
Homepage
Change
Are you sure you want to leave?
YesNoHomepage script $ ('A '). click (function () {myconfirm (function () {window. location. href = "index. php ";}, function () {return false ;}); function myconfirm (fun_yes, fun_no) {$ ('# yes '). unbind (); $ ('# no '). unbind (); $ ('# yes '). click (function () {fun_yes () ;}); $ ('# no '). click (function () {fun_no () ;}); $ ('# myconfirm '). show ();} script
A popular dialog box plug-in,
Http://aui.github.io/artDialo...
Listen to browser close events
Can't I bind an onblur event to the editor?