Skip to content

Instantly share code, notes, and snippets.

@mantismamita
Created December 18, 2013 20:26
Show Gist options
  • Save mantismamita/8029350 to your computer and use it in GitHub Desktop.
Save mantismamita/8029350 to your computer and use it in GitHub Desktop.
Alert for geolocation from desktop
$(document).ready(function(e) {
if(navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)) {
return;
} else {
alert("Please note: Your position is determined from your IP address and therefore may be inaccurate. The address indicated may need correction.");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment