I need to reformat the function below in the form of an jQuery.ajax call in order to do error handling (the script is apparently timing out on some calls). What would this look like if converted to .ajax() with an error callback and a success callback?
jQuery.getJSON("http://boss.yahooapis.com/ysearch/web/v1/tobacco"
+"appid=myAppID"
+"&lang=en"
+"&format=json"
+"&count=50"
+"&view=keyterms"
+"&callback=?",
function (data) {
// if no error, do something, else gracefully exit
});
1 Answer