I have two files, home.html and mobilehome.html, and I am trying to switch between them when the screen width goes below a certain size.
if (screen.width <= 600) {
document.location = "HomeMobile.html";
}
This approach works well in Responsive testing mode on chrome and firefox, however, it does not function as expected when simply resizing the window.
I also attempted combining both pages using viewport, but I would prefer to hide most of the content when switching to mobile view to maintain a cleaner interface.