Jcfg.J Jcfg.J - 1 month ago 12
Javascript Question

Change HTML file based off of Screen Width

So I have a website, and I want to have different versions of the site that adjust to the screen width. I realize that I can use different style sheets and such to do so, but I am curious if I can do a cleaner method that just goes to a different HTML file depending on the width.

Ex (pseudo-code):

if (width > 900) go to largeSite.html... else if (width < 900 && width > 500) go to mediumSite.html etc..

Answer

I think JavaScript can help.

Image :  enter image description  here