Skip to content

Instantly share code, notes, and snippets.

@themorgantown
Created March 16, 2012 19:51
Show Gist options
  • Save themorgantown/2052208 to your computer and use it in GitHub Desktop.
Save themorgantown/2052208 to your computer and use it in GitHub Desktop.
This document redirects retina displays to a different page. It looks for the pixel density of the device and triggers a redirect if the density is 2 or greater.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>For regular devices.</title>
<script type="text/javascript">
if( window.devicePixelRatio >= 2 ){
window.location.replace("http://tumultco.com/blog/wp-content/uploads/2012/03/retinatestdocument/forretina.html");
}
</script>
</head>
<body>
<h1> For regular devices. </h1>
<p>If you hit this page from a retina-enabled device, you'll be sent to <a href="http://tumultco.com/blog/wp-content/uploads/2012/03/retinatestdocument/forretina.html">here</a>.</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment