Ievgen
Ievgen

Reputation: 4443

jquery ajax start handler not firing

jquery ajax start handler not firing. Why? jquery 1.6.2

Code example:

$(document).ready(function(){
 $('#rr-loading-overlay').ajaxStart(function(){
  alert('asda');
 }).ajaxStop(function(){

 });

 $.ajax({
    type: "GET",
    url: 'service.com',
    crossDomain: true,
    dataType: "json",
    success: function(data) {
     formatData(data);
    },
    error: function(jqXHR, textStatus, errorThrown) {
     alert(textStatus + ' / ' + errorThrown);
    }
 });

    function formatData(data){
 }

})

also i tried and nothing.

 $(document').ajaxStart(function(){
   alert('asda');

     })

Upvotes: 0

Views: 4283

Answers (2)

bpile
bpile

Reputation: 380

I had run into same problem. What worked for me was binding ajaxStart before making any AJAX request

Upvotes: 2

ShankarSangoli
ShankarSangoli

Reputation: 69915

It works for me

Working demo

Upvotes: 3

Related Questions