Click delete, and a prompt box (modal box) will be prompted to confirm whether to delete. After clicking OK, the ajax event will be executed. How is this implemented?
I am new to front-end content, and the source code for the implementation of this pop-up box has not been found.
delete
is a pop-up box with fixed style through class="js-ajax-dialog-btn".
Searched for two pieces of jquery code $(.js-ajax-dialog-btn").... Even if it is blocked, there will still be a pop-up box.
The ideas of the bosses are very good, thank you!
Because the cache is too powerful, the code I found is correct and I changed the source code. .
Confirm Yes or No to execute ajax!
Determine whether the returned true or false
true executes ajax
false and closes the modal box
then it is ok.
If you don’t pursue results, just
If you want something beautiful, look for various UI libraries and you will find this, for example
https://ethaizone.github.io/B...
When you click delete, only bind the event of the pop-up prompt box. In the pop-up box, bind the event for the confirmation button and make the corresponding ajax request.
When you click delete, a modal box pops up, and then bind the ajax event to the confirmation button, then you can click OK to execute asynchronously.
It is recommended to use the layer plug-in, which is simple and convenient.
prompt example: