A Pen by Luke Galea on CodePen.
Created
September 12, 2013 14:56
-
-
Save lukegalea/6538864 to your computer and use it in GitHub Desktop.
A Pen by Luke Galea.
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
<p>Your device:<span class="ua"></span></p> | |
<a href="www.google.com">A normal link</a> | |
<br/> | |
<a href="www.google.com" class="no-android">A link that doesn't work on android</a> |
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
$(function() { | |
var ua = (window.navigator && navigator.userAgent) || "UNKNOWN"; | |
$('.ua').text(ua); | |
if( /android/i.test(ua) ) { | |
$('.no-android').click(function() { | |
alert("We're sorry, but you can't use android to purchase our products.\nPlease call 555-414-1232 to make a purchase."); | |
return false; | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment