George Stoqnov George Stoqnov - 1 year ago 84
Javascript Question

jQuery - compatibility issue with Firefox

At the moment, I am learning how to write in javascript and jquery. However, I wrote a simple jquery code where if you resize the window the page is automatically refreshed. It is working on Chrome, IE, Edge, Opera but not in Mozilla Firefox. Can someone check the code and tell me what is wrong and why it doesn't work with Firefox. I would be really grateful and thank you in advance.

$(document).ready(function() {

Best Regards,

George S.

Answer Source

Try calling the function outside of $(document).ready

If that doesn't work try window.location.href=window.location.href; instead of location.reload(true);

$(document).ready( function () {
    // nothing in here


 function yourfunction(){


$(window).resize( function () {