Last active
August 29, 2015 14:13
-
-
Save iammart/f58484d6107de7657585 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var COOKIE_NAME = 'iphone_redirect'; | |
$go = $.cookie(COOKIE_NAME); | |
function appstore() { | |
var answer = confirm("Download the FREE \nTorbay Hotels App today") | |
if (answer) window.location = "http://itunes.apple.com/app/id532107287?mt=8"; | |
$.cookie(COOKIE_NAME, 'notice', { path: '/', expires: 10}) | |
} | |
function isiPhone(){ | |
return ( | |
(navigator.platform.indexOf("iPhone") != -1) || | |
(navigator.platform.indexOf("iPod") != -1) || | |
(navigator.platform.indexOf("iPad") != -1) | |
); | |
} | |
if(isiPhone() && $go == null) appstore(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment