javascript - jquery ajax file exist function not working in safari and firefox on mac -
i have script creates text file while it's running , deletes when finished. wrote following script report user when script running, console logs activity:
<!doctype html> <html> <title>news</title> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="http://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script> </head> <body> <script type="text/javascript"> // return feed results database $(document).ready(function() { // ajax db refresh alert code setinterval(ajaxcall, 10000); function ajaxcall() { $.ajax({ url:'http://davidcool.com/feeds/test.txt', type:'head', error: function(res){ console.log('error: '+res); $('#database_alert').fadeout(1000); }, success: function(res){ console.log('success: '+res); $('#database_alert').fadein(1000); interval = window.setinterval(function() { $('#msg').fadeout(1000).fadein(1000); console.log('still going!'); }, 2000); } }); }; }); </script> <div id='database_alert' style='display: none;'><div id='msg'>feeds updating...</div></div> </body> </html>
it works planned in mac chrome, safari , firefox don't work consistently. correctly report file not existing @ first, correctly report when file created, when file deleted continue report file there! chrome detects file being deleted , works properly. ideas?
thanks!
Comments
Post a Comment