Skip to content

Instantly share code, notes, and snippets.

@tomshaw
Created January 21, 2013 00:30
Show Gist options
  • Save tomshaw/4582811 to your computer and use it in GitHub Desktop.
Save tomshaw/4582811 to your computer and use it in GitHub Desktop.
WTF?
var callServer = function(args, callback) {
var url = "http://www.urbandictionary.com/iphone/search/define";
$.ajax({
url: url,
data: args,
dataType: "jsonp",
type: "GET",
success: function(result) {
callback(result);
}
});
}
var search = {term:"dafuq"};
callServer(search, function(resp) {
console.log(resp.list[0].definition);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment