When there is an activation button in bootstrap, the button becomes unavailable;
According to the method described in the official website, add a data-loading-text="Loading..." attribute to the button button, and then the overall code of js is as follows:
The code copy is as follows:
<button type="button" id="myButton" data-loading-text="Loading..." autocomplete="off">
Loading state
</button>
<script>
$('#myButton').on('click', function () {
var $btn = $(this).button('loading')
// business logic...
$btn.button('reset')
})
</script>
The autocomplete="off" attribute is for the FF browser to be disabled after the page is loaded.
When I was using the above code directly, I found that the loading state was not available.
Then I changed it myself and wrote it like this, it's OK
The code copy is as follows:
<script>
// Used to change the button loading status of the button when the joke login button and review button
function load() {
var btn = $("#btn_login");
btn.button('loading');
setTimeout(function () { btn.button('reset'); },2000);
}
</script>
<button type="button" data-loading-text="Loading..." autocomplete="off" onclick="loag()" id="btn_login">Login</button>
We can realize our requirements by making a little change. I don’t know if the official part has been put on without testing. I recommend the solution to my friends here.