ajax Preloader is not working in chrome,safari while working in firefox -


i have problem in "ajax loader image". on firefox working fine on chrome ajax loader image not seems.

i have attributes on sidebar when check attribute products changes according , preloader image generated before ajax completed.what doing when check on attribute first insert gif image in div html , show using .show() method , after success of ajax set div html null , hide it.

you can see div in firebug (<div id="ajax_loader_div" style="display:none;"></div>)

code complicated that's why not posting code here.really sorry that.you can see on http://vcompare4u.com/wpcompare/products/laptops/

i need help.please thanks!!!

i've seen code

it known synchronous requests lock ui. not surprisingly on chrome , safari, (it in firefox interestingly)

can try

jquery('#customtag_widget-2 .compare_attribute').bind('change',   jquery.filterproductscompare2 = function () { $.ajaxsetup({async:false}); jquery('#ajax_loader_div').css('display', 'block'); jquery('#ajax_loader_div').html('<img src="http://vcompare4u.com/wpcompare/wp-content/themes/compare/_assets/img/ajax-loader.gif" / >');  jquery('#customtag_widget-2 .compare_attribute_group').each(function () {            jquery(this).children().each(function () {              if (jquery(this).children('.compare_attribute').attr('checked')) {                  if (jquery(this).children('.compare_attribute').attr('name').indexof('b[') != -1) {                      brands.push(jquery(this).children('.compare_attribute').attr('value'));                  }                  if (jquery(this).children('.compare_attribute').attr('name').indexof('c[') != -1) {                      categories.push(jquery(this).children('.compare_attribute').attr('value'));                  }              }          })      } else {          minmaxarr = jquery(this).attr('value').split(';');          minprice = minmaxarr[0];          maxprice = minmaxarr[1];      }      if (!jquery.support.placeholder) {          if (isemptyplaceholder == 1) {              jquery(this).val('search...');          }      }  })  if (jquery('#dont_change_price').is(':checked')) {     minprice = jquery('#overall_min').val();     maxprice = jquery('#overall_max').val(); } else {}  jquery.ajax({      url : file_url,     data : {         ajaxsearch : '1',         s : 'compare',         ki : keywords_comparei,         product : '',         c : categories,         b : brands,         checked_id : checked_string,         dont_change_price : dont_change_price,         min : minprice,         max : maxprice,         product_category : product_category     },     success : function (data) {         // stuff here     } });  jquery.ajax({     url : bracket_file_url,     data : {         ajaxsearch : '1',         s : 'compare',         ki : keywords_comparei,         product : '',         c : categories,         b : brands,         checked_id : checked_string,         min : minprice,         max : maxprice,         product_category : product_category     },     success : function (bracket_data) {         // stuff here     }  }); if (!jquery('#dont_change_price').is(':checked')) { jquery.ajax({      url : price_file_url,     data : {         ajaxsearch : '1',         s : 'compare',         ki : keywords_comparei,         product : '',         c : categories,         b : brands,         checked_id : checked_string,         min : minprice,         max : maxprice,         product_category : product_category      },      success : function (price_data) {          // stuff here      }  }); } jquery('#ajax_loader_div').hide(); jquery('#ajax_loader_div').html('');   $.ajaxsetup({async:true}); }); 

what trying do synchronous request each ajax request , instead of using success functions using ajax request separately. due synchronous nature each request processed 1 after another.

inspecting code in chrome console i've seen ajax loader little moment hided immediately.

here reference problem same yours

force ui repaint in webkit (safari & chrome) right before synchronous "ajax" request


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -