Home › Forums › JavaScript › Screen resolution detect and redirect to URL w/ manual switch back › Reply To: Screen resolution detect and redirect to URL w/ manual switch back
downcasteyes,
I’m using a basic HTML site and need the code for a mobile redirect as well as let the user click on a link
to view full site.
I’m currently using this code:
if (document.location.search.indexOf(“skipmobile”) >= 0) {
document.cookie = “skipmobile=1”;
}
else if ((document.location.hostname.match(/.mobi$/) || screen.width < 699)
&& document.cookie.indexOf("skipmobile") == -1)
{
document.location = "http://dacopywriter.com/mobile-3/index.html";
}
and it works fine but will not validate in W3C:
(required attribute “type” not specified )
Do you have some clean code that I can just drop into the ?