Skip to content

Instantly share code, notes, and snippets.

@iammart
Last active August 29, 2015 14:13
Show Gist options
  • Save iammart/f58484d6107de7657585 to your computer and use it in GitHub Desktop.
Save iammart/f58484d6107de7657585 to your computer and use it in GitHub Desktop.
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