javascript - Reload page after some time on mobile devices -
i have page gets contents servlet. page gets updated javascript every minute. when mobile wakes (i using https://github.com/paulokopny/jquery.wakeup-plugin">jquery.wakeup-plugin) , 'asleep' more 60 secs, call :
location.reload(true); or
window.location.href = window.location.href; first line works chrome , firefox not safari, , second line doesn't work safari , chrome. reloads page, page doesn't update. shows content before went sleep. after pressing f5 browsers reload fine.
any tips on how fix refresh?
thanks!
update
var bell_id = $.wakeup(function(sleep_time) { if (sleep_time > 59000) { //location.reload(true); not working safari window.location.href = window.location.href; $.ignorebell(bell_id); } });
u mean that?
$(document).ready(function() { setinterval(function() { cache_clear() }, 60000); }); function cache_clear() { window.location.reload(true); // window.location.reload(); use if not remove cache }
Comments
Post a Comment