Created
February 22, 2016 08:48
-
-
Save vicchi/bffac43b7c5f9581a979 to your computer and use it in GitHub Desktop.
what3words API authentication with jQuery
This file contains hidden or 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
var json = (function() { | |
var json = null; | |
$.ajax({ | |
'async': true, | |
'global': false, | |
'url': "./config.json", | |
'dataType': "json", | |
'success': function (data) { | |
json = data; | |
} | |
}); | |
return json; | |
})(); | |
var key = json.what3words.key; | |
var options = { | |
key: key | |
lang: 'en' | |
}; | |
var w3w = new What3words(options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment