Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
How to call an ajax loading spinner on a page that renders no ajax
// Loading Spinner in javascript file

function start_spinner() {
    ajaxDone= false;
    setTimeout(function() {
        if(!ajaxDone) $(".loading").show();
    }, 1500);
}

function stop_spinner() {
    ajaxDone=true;
    $(".loading").hide();
}

$(document).ajaxStart($.blockUI).ajaxStop($.unblockUI);

    var ajaxDone;
    // show spinner on AJAX start
    $(document).ajaxStart(start_spinner).ajaxSuccess(stop_spinner).ajaxError(stop_spinner);

Calling this in .html.erb file

<script>
      function start_spinner(){
          $('#Register').onclick();
 }
</script>

The loading spinner works correctly for pages that load ajax but how do I call the spinner when no ajax is present??

Thanks

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!