This article mainly introduces how bootstrap changes the button loading status. If you need a friend, refer to the activation button in bootstrap and the button becomes unavailable;
According to the method described on the official website, add a data-loading-text = "Loading..." attribute to the button. Then the overall js Code is as follows:
The Code is as follows:
Loading state
Script
$ ('# MyButton'). on ('click', function (){
Var $ btn = $ (this). button ('loading ')
// Business logic...
$ Btn. button ('reset ')
})
Script
Specifically, the autocomplete = "off" attribute is for FF browsers. The disabled status will not be automatically removed after the page is loaded.
When I directly use the above code, I find that the loading status does not exist.
Then I changed it myself and wrote it like this, and it would be okay.
The Code is as follows:
Script
// Used for logging in with a smile and changing the loading status of the button for review
Function loag (){
Var btn = $ ("# btn_login ");
Btn. button ('loading ');
SetTimeout (function () {btn. button ('reset') ;}, 2000 );
}
Script
Login
After a few changes, we can achieve our requirements. I don't know if the official website is not tested. Here we recommend the solution to our friends.