admin管理员组文章数量:1326303
When I navigate back using the browser back button in Chrome/ Firefox my website works just as expected (the same as it would if loaded without navigating backward).
In Safari after navigating back I can't get any 'on load' type event to fire whether the standard document ready or some hackaround found on here on StackOverflow. I'm not doing anything special, I just really need to call:
$( document ).ready(function() {
// analyticsEvent();
// startAnimation();
// etc();
});
Has anyone encountered the same problem?
When I navigate back using the browser back button in Chrome/ Firefox my website works just as expected (the same as it would if loaded without navigating backward).
In Safari after navigating back I can't get any 'on load' type event to fire whether the standard document ready or some hackaround found on here on StackOverflow. I'm not doing anything special, I just really need to call:
$( document ).ready(function() {
// analyticsEvent();
// startAnimation();
// etc();
});
Has anyone encountered the same problem?
Share Improve this question asked Apr 20, 2016 at 17:10 ztechztech 5606 silver badges13 bronze badges 1- i Think that's happen because safari uses cached javascript, maybe use pageshow method insted of .ready will work – Nico Commented Apr 20, 2016 at 17:17
1 Answer
Reset to default 11Try this
$(window).bind("pageshow", function(event) {
if (event.originalEvent.persisted) {
window.location.reload()
}
});
本文标签: Fire JQuery Javascript after Back Button in Safari 9Stack Overflow
版权声明:本文标题:Fire JQuery Javascript after Back Button in Safari 9 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742207404a2433074.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论