Created
April 27, 2018 15:39
-
-
Save jguadagno/7085cd501a06de41197578b827628cd8 to your computer and use it in GitHub Desktop.
Foursquare Autocomplete jQuery Plugin
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
$("#venue").foursquareAutocomplete({ | |
'latitude': 47.22, | |
'longitude': -122.2, | |
'oauth_token': "your oauth token", | |
'minLength': 3, | |
'search': function (event, ui) { | |
$('#venue-name').html(ui.item.name); | |
$('#venue-id').val(ui.item.id); | |
$('#venue-address').html(ui.item.address); | |
$('#venue-cityLine').html(ui.item.cityLine); | |
$('#venue-icon').attr("src", ui.item.photo); | |
return false; | |
}, | |
'onError' : function (errorCode, errorType, errorDetail) { | |
var message = "Foursquare Error: Code=" + errorCode + | |
", errorType= " + errorType + | |
", errorDetail= " + errorDetail; | |
log(message); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment