A simple script that changes the button icon to the fontawesome Spinner and reverts it when done
-
Download the script
-
Import the script via
<script src="dist/jquery.buttonloadingindicator.js"></script>
-
Use it
Start loading
$("a").on("click", function(ev) {
ev.preventDefault();
$(this).startLoading();
// Do work
$(this).stopLoading();
});