Target Mobile Devices

Comes in handy when working with older devices.

<script>
function mobileVerification() {
if ((navigator.userAgent.indexOf("iPhone") > 0) || (navigator.userAgent.indexOf("iPod") >
0) || (navigator.userAgent.indexOf("iPad") > 0)) {
var result = confirm("An iPhone app exists for this event. Would you like to download it? Une application iPhone existe pour l’&eacute;v&eacute;nement. Souhaitez-vous la
t&eacute;l&eacute;charger ?");
if (result) {
window.location = "https://itunes.apple.com/app/id586657330";
}
}
else if (navigator.userAgent.indexOf("Android") > 0) {
var result = confirm("An Android app exists for this event. Would you like to download it? Une application Android existe pour l’événement. Souhaitez-vous
la télécharger ?");
if (result) {
window.location = "https://play.google.com/store/apps/details?id=com.greencopper.android.festivalvoyageur";
}
}
}
</script>

 

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.