June 2017
Beginner to intermediate
368 pages
8h 31m
English
Let's use some simple JavaScript to determine firstly if the user's browser actually supports the Geolocation API and, if it does, attempt to obtain the location. The code is based on YUI (Yahoo User Interface)--and if you go ahead and adapt a Moodle plugin as we are here then chances are you may find yourself modifying YUI.
Let's study the code we will be using. Firstly, we need an initializer function. This will determine if geolocation services are available:
initializer : function () { Y.Geo = { getCurrentPosition: ...Read now
Unlock full access