Hello. I'm looking for a short media query/JavaScript script that will tell the browser to load a specific html file depending on the device or the browser width. Any tutorials anyone can point me to? Thank you in advance.
FS
Printable View
Hello. I'm looking for a short media query/JavaScript script that will tell the browser to load a specific html file depending on the device or the browser width. Any tutorials anyone can point me to? Thank you in advance.
FS
Generally speaking it's a good practice to use CSS and media queries to reformat a single page to display differently on different devices.
Detecting screen size isn't particular difficult, though.
Code:var screenSize=document.documentElement.clientWidth;
if(screenSize<someNumber){
window.location="somepage.html"
}
Thanks for that. I'll try that later. I'm also going to try the jQuery Ready function...I
ll post the code if it works properly.