I try to implement AJAX in my website. When the content of the div changepass is clicked then it should load changepass.template.php. Here is the code im using for that.
$(function() {
$(".changepass").click(function() {
$(".block1").load("views/changepass.template.php");
return false;
});
My question is how to show GIF Animation (loading.gif) while the page changepass.template.php is fully loaded. Give me some code tips Please.
There are many approaches to do this.
A simple way to do:
JS:
Edited display:block to show() after suggestion from James Wiseman 🙂