Skip to content

Instantly share code, notes, and snippets.

@mattm
Created January 18, 2012 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mattm/1633149 to your computer and use it in GitHub Desktop.
Save mattm/1633149 to your computer and use it in GitHub Desktop.
Calling Big Huge Thesaurus's API with jQuery
$.ajax({
url : "http://words.bighugelabs.com/api/2/youapikey/" + word + "/json?callback=?",
dataType : 'json',
complete : function(jqXHR, textStatus) {
if (textStatus == 'parsererror') {
// Did not find any synonyms
alert("404 error because no synonyms exist for this word");
}
},
success : function(data) {
// Found synonyms
alert(data);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment