Skip to content

Instantly share code, notes, and snippets.

@Hadryan
Forked from braddown/mobile-browser-detect
Created December 28, 2023 15:15
Show Gist options
  • Save Hadryan/0a65ae9e338449faa6c6647aad3e7000 to your computer and use it in GitHub Desktop.
Save Hadryan/0a65ae9e338449faa6c6647aad3e7000 to your computer and use it in GitHub Desktop.

Revisions

  1. @braddown braddown created this gist Aug 3, 2012.
    22 changes: 22 additions & 0 deletions mobile-browser-detect
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Redirect</title>
    <script type="text/javascript"> // <![CDATA[
    //iPhone Version:
    if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
    window.location = "http://goo.gl/IWd7J";
    }
    //Android Version:
    if(navigator.userAgent.match(/android/i)) {
    window.location = "http://goo.gl/1K1Hi";
    }
    //Blackberry Version:
    if(navigator.userAgent.match(/blackberry/i)) {
    window.location = "http://goo.gl/jH2wD";
    }

    </script>
    </body>
    </html>