For all major browsers (except IE), the JavaScript onload
event doesn’t fire when the page loads as a result of a back button operation — it only fires when the
I have used an html template. In this template's custom.js file, there was a function like this:
jQuery(document).ready(function($) {
$(window).on('load', function() {
//...
});
});
But this function was not working when I go to back after go to other page.
So, I tried this and it has worked:
jQuery(document).ready(function($) {
//...
});
//Window Load Start
window.addEventListener('load', function() {
jQuery(document).ready(function($) {
//...
});
});
Now, I have 2 "ready" function but it doesn't give any error and the page is working very well.
Nevertheless, I have to declare that it has tested on Windows 10 - Opera v53 and Edge v42 but no other browsers. Keep in mind this...
Note: jquery version was 3.3.1 and migrate version was 3.0.0