Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jguadagno/7085cd501a06de41197578b827628cd8 to your computer and use it in GitHub Desktop.
Save jguadagno/7085cd501a06de41197578b827628cd8 to your computer and use it in GitHub Desktop.
Foursquare Autocomplete jQuery Plugin
$("#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