Last active
August 29, 2015 14:20
-
-
Save maxkatz/a59737bc5d9c41dd73e7 to your computer and use it in GitHub Desktop.
Code for Native APIs Webinar - April 29, 2015
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
// Alert | |
navigator.notification.alert( | |
'Build apps fast with Appery.io', | |
alertDismissed, | |
'My App', | |
'Got it.' | |
); | |
function alertDismissed () { | |
alert ("Nice - that worked"); | |
} | |
// Geolocation | |
var onSuccess = function(position) { | |
Apperyio("lat").text(position.coords.latitude); | |
Apperyio("lng").text(position.coords.longitude); | |
}; | |
function onError(error) { | |
alert('code: ' + error.code + '\n' + | |
'message: ' + error.message + '\n'); | |
} | |
navigator.geolocation.getCurrentPosition(onSuccess, onError); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment