How to Show Loading Spinner in jQuery?

Rate this post

Today, We want to share with you jquery loading spinner example.In this post we will show you Bootstrap Spinners – examples & tutorial, hear for how to add or create ajax loading spinner before send data. we will give you demo and example for implement.In this post, we will learn about Simple spinner on ajax call in jquery with an example.

JQuery AJAX Loading Spinners Tutorial with Examples


<!DOCTYPE html>
    <title>JQuery Ajax Loading Spinner Example -</title>
    <script src=""></script>  
    <link rel="stylesheet" type="text/css" href="style.css">
    <div class="text-center">
        <h2>JQuery Ajax Loading Spinner Example -</h2>
        <button id='findAllProducts'>Click Here to Get All Products</button>
    <div id="data-table" style="width: 100%;" class="display-none">
        <table border="2">
    <div id="loader" class="ssc-dual-ring display-none overlay"></div>
    <script type="text/javascript" src="main.js"></script>


body {
    background: #ececec;

.display-none {
    display: none !important;

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,.8);
    z-index: 999;
    opacity: 1;
    transition: all 0.5s;

.ssc-dual-ring {
    display: inline-block;
.ssc-dual-ring:after {
    content: " ";
    display: block;
    width: 64px;
    height: 64px;
    margin: 5% auto;
    border-radius: 50%;
    border: 6px solid #fff;
    border-color: #fff transparent #fff transparent;
    animation: ssc-dual-ring 1.2s linear infinite;
@keyframes ssc-dual-ring {
    0% {
        transform: rotate(0deg);
    100% {
        transform: rotate(360deg);
    background: #e2e222;
    border: 1px solid #e2e222;
    padding:  10px 20px;
    text-align: center;
#data-table table{
    margin: 20px auto;

Free Live Chat for Any Issue


$('#findAllProducts').click(function () {
        type: "GET",
        url: "",
        dataType: 'json',
        beforeSend: function () {
        success: function (data) {
            if (data.length > 0) {
                let productList = "";
                for (let i = 0; i < data.length; i++) {
                    var key = i + 1;
                    productList += ""
                    productList += "" + key + "";
                    productList += "" + data[i].uri + "";
                    productList += ""
                $('#data-table tbody').html(productList);
        complete: function () {


I hope you get an idea about ajax loading spinner using jquery.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.