
Untitled
By: a guest on
Jun 12th, 2012 | syntax:
None | size: 0.43 KB | hits: 13 | expires: Never
jQuery Deferreds - Pass result of $.when to $.then
function ajaxfn(data) {
prevalidate(data);
return $.ajax(settings);
}
$.when(ajaxfn).then(function() {
// put 'xyz' on the page somewhere.
});
$.when(ajaxfn()).then(function(data) {
// put 'xyz' on the page somewhere.
});
function ajaxfn(data) {
prevalidate(data);
return $.ajax(settings);
}
ajaxfn().then(function(response) {
console.debug(response);
});