The Duck Pad

Making an awesome iPad app within 6 weeks

0 notes

Redirecting non-iPad users

Once the DuckPad project is completed, we’ll be making it publicly accessible online however as it is designed strictly with the iPad in mind it might not work so well on a desktop.

Clement and Khal set about creating a Javascript snippet to redirect non-iPad traffic back to our main website. By using the platform element in the navigator object in the DOM, rather than the UserAgent we can accurately detect devices accessing our website. 

<script type="text/javascript">

  if(!(navigator.platform.match(/^(iPad)$/))){

    document.location.href = "http://www.cyber-duck.co.uk";

  }

</script>