I made one small ajax function which returns json object received from server, I checked this function on firefox, operamini, works fine and during posting data to server I am able to see spinner image, but incase of google chrome I can't see spinner while posting, when async
is false
, if I make async : true
, I can see spinner.
Can someone tell me solution for same, all functions in my script are working fine, except spinner only on chrome.
Any more things I can add to show spinner for chrome to existing function ? The only way left for me is to modify the function, because this function is called in many other functions in my script which is very long too.. I will be happy if anyone can provide me alternate solution.
Chrome : Version 28.0.1500.71 Ubuntu 12.04 (28.0.1500.71-0ubuntu1.12.04.1)
jQuery v2.1.3
This is my function
function _get_data(options) {
var result={};
$.ajax({
url : options.url,
async : false,
cache : false,
data : options.data,
beforeSend: function() {
$(options.before.element).html(options.before.html);
},
method : "POST",
dataType : "json",
success:function(data) {
result = data;
}
});
return result;
}
This is how I call it
var my_data = _get_data({
url :'http://dba.org/test',
before : {
element : "#loading",
html : '<img class="loader" src="data:image/png;base64,iVBORw0KGgoAAAANSUhE ... somemore"/>'
},
data : { firefox : true, chrome : false }
});
If anyone here got solution already please share
Thanks in advance,
Wish You Happy New Year In Advance..