I have the following code where the user clicks on a button and runs an executable in the background. Once the executable is complete it proceeds to a new page. It takes a few seconds to load the new page and I want to display a small animation to the user.
At the moment I am able to change the text of the button from Execute to Loading... once the user clicks on the button.
How can I animate or loop the text from Loading... -> Loading.. -> Loading. until the new page loads? I just want to animate the periods.
Any resources on this is helpful.
$(document).ready(function() {
$('#loading').on('click', function() {
$(this).button('loading').delay()
});
});
<form class="navbar-form navbar-left" method='POST' action='App/Address'>{% csrf_token %}
<div class="form-group">
<input type='submit' class="btn-lg btn-danger" value='Execute' name='action' {% if read %} disabled {% endif %} id="loading" data-loading-text="Loading..." autocomplete="off" />
</div>
</form>