Enhancing user experience friendliness-prompt when jquery easyui window is closed

Source: Internet
Author: User

This is what I wrote in the pop-up window. CopyCodeThe Code is as follows: $ ('# A'). Click (function () {// click the event
$ ('# W'). Window ({// window Initialization
Title: 'random point', width: 400, height: 300, iconcls: 'icon _ add ',
// Important part
Onbeforeclose: function () {// event triggered before the panel is closed
If (confirm ('the window is closed. Make sure that your current operation is saved. \ N continue to close the window? ')){
$ ('# W'). Window ('close', true); // call the close method here. True indicates that the onbeforeclose callback function is ignored when the Panel is closed.
} Else
Return false;
}
});
});

In this case, the confirm window pops up when you click the red X or cancel | close button. Click OK to close the window and click Cancel to retain the window.
If you do not want to bring up a prompt, you can directly call: $ ('# W'). Window ('close', true)

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.