How can I use promise.done() with a function that accepts an argument to use in the ajax url to be returned ?
I've done this succesfully without the argument but if I wanted to put an argument in to be used in the url could I do,
function citeAjax(urlId) {
return $.ajax({
type: 'GET',
url: 'https://www.sciencebase.gov/catalog/itemLink/' + urlId + '?format=jsonp',
jsonpCallback: 'getSBJSON',
contentType: "application/json",
dataType: 'jsonp'
});
}
var citePromise = citeAjax();
but I'm not sure how to put in the argument,
citePromise(In here maybe ??).done {
// Do stuff ??
});
could I do something like setUrl in the function before return??