I have an ajax call that I want to display an ajax loader image before
it makes the call and then hide that image after it completes the
call.  The below code is working fine in FF.  But when the code is run
in IE, for some reason the ajax call is made first and then the image
isn't displayed until after the ajax call has completed.  I've tried
putting the .show() method before the ajax call and even in the
beforeSend option of the ajax call, for some reason IE STILL makes the
ajax call, and waits for it to complete, before it displays the
image.... Anyone have any ideas???

CSS:
#ajaxLoader{
  display: none;
  background: url(images/ajax-loader.gif) no-repeat;
}

jQuery:

ajaxLoaderImage = $("#ajaxLoader");
$(ajaxLoaderImage).show();

$ajax({
  /*
    beforeSend: function(){
      $(ajaxLoaderImage).show();
    },
  */
  type:"GET",
  dataType: 'xml',
  url: 'someHandler.php',
  data: 'data=something',
  async: false,
  success: function(xml){
    response = $(xml);
  },
  complete: function(){
    $(ajaxLoaderImage).hide();
  }
});

Reply via email to