Home >Web Front-end >Layui Tutorial >Layui pop-up layer crash solution
Today I used layui’s pop-up layer plug-in and found that binding the pop-up layer to a button would crash when opening the pop-up window.
Reason: The Button button is used in the form. When clicked, the default event will be triggered, but I did not fill in the action of the form, so the pop-up layer will crash!
Solution:
Method 1: Replace the button label with another label, such as span, and there will be no crash problem;
Method 2: Specify the button Type: type = "button", because the default type of button in the form is = "submit". If it is changed to button, there will be no default event of the form.
For more informationlayui, please pay attention to the layui tutorial column on the PHP Chinese website
The above is the detailed content of Layui pop-up layer crash solution. For more information, please follow other related articles on the PHP Chinese website!