I am using jquery window.resize function with location.reload method because I want to reload my page when mobile user change from portrait to landscape and its working great in my desktop browser while I change my window size but when I get it in mobile my window.resize event getting fired every time when I scroll up or down in mobile. I dont know why its happening on scroll event when it is supposed to be happened only on portrait and landscape.
Here is my code.
$(document).ready(function () {
function resize() {
alert("Hello")
resize();
});
$(window).resize(function() {
location.reload();
});
So where its going wrong and whats the solution?