When AJAX raises a timeout event, the loading spinner keeps on spinning.

    $("#mySearchField").autocomplete({
        minLength: 3,
        delay: 300,
        source: function (request, response) {
            $.ajax({
                type: "POST",
                url: "/query",
                data: { first: $('#mySearchField').val() },
                success: response,
                timeout: 3000
            });
        }
    });

How can I stop the spinner?

1 Answers

1
Raj On Best Solutions

Add below code in both success and complete method will resolve this issue.

$("#textboxid").removeClass("ui-autocomplete-loading");