Skip to content

Instantly share code, notes, and snippets.

@lukegalea
Created September 12, 2013 14:56
Show Gist options
  • Save lukegalea/6538864 to your computer and use it in GitHub Desktop.
Save lukegalea/6538864 to your computer and use it in GitHub Desktop.
A Pen by Luke Galea.
<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>
$(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