ajax - Force jQuery / Javascript to wait for php script to load -


i'm having trouble making ajax request wait php script load, script works in chrome not ie in both instances.

on button press script should fire php script wait complete display alert has complete in ie alert box displays , script never runs. work in chrome expected.

this attempt 1

 function reloadcalls(){   $('#reload').prop('disabled', true);   $('.ajax-progress-throbber').show();   $.ajax({               url: '/kpi/technet_proj/cron/proj_cron.php',      success: function(r){        alert('calls loaded');               location.reload();      },      error: function(r){        alert('calls not loaded');      }   });  } 

this attempt 2

 function reloadcalls(){   $('#reload').prop('disabled', true);   $('.ajax-progress-throbber').show();   $.ajax({               url: '/kpi/technet_proj/cron/proj_cron.php',      success: function(){        alerts();      },      error: function(){        alert('calls not loaded');      }   }); }  function alerts(){   alert('calls loaded');   location.reload(); } 

i have tried adding async:false kind of work doesn't display throbber , jams browser until script has complete.

any appreciated

i worked out answer add cache: false ajax request.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -