jquery has a lot of pop-up box plug-ins, boxy should be counted on the function and effect are also a good paragraph. Let's look at an effect chart first.
Alert and confirm pop-up boxes are often used in web development, and deletion buttons are often added to the delete button in asp.net to avoid accidentally deleting data, as in the picture above. We typically write code like this.
The above code is very simple, the Confirm pop-up box will have two buttons, click OK to return True, click Cancel return False. There are also confirm methods in the boxy plug-in, and the calling code is as follows:
$ (document). Ready (function () {
$ (#btnDel). Click (function () {
boxy.confirm ("Are you sure you want to delete?"). ", function () {}, null);
return false;
});
Boxy's confirm method has three parameters, namely, the confirmation information content, the pop-up box clicks OK callback function, some set item like the title. If you do not add return False in the above code, the pop-up box flashes, and then the event that deletes the button is executed. Plus return false, then either click OK or cancel will not perform background events, this is clearly not up to our requirements, it seems only to hit the click of the decision after the callback function. You can encapsulate the boxy confirm in a common JS file:
The calling code for the page is as follows:
$ (document). Ready (function () {
$ (#Button1). Click (function () {return Confirmo (this), do you confirm deletion? ") });
});
After this modification, the server event is executed when you click the OK button on the pop-up box.
The above mentioned is the entire content of this article, I hope you can enjoy.