Created
June 18, 2013 09:18
-
-
Save wwgist/5803904 to your computer and use it in GitHub Desktop.
JQUERY: ajax.deferred
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.customMethod = function(){ | |
return $.ajax({ | |
url: '/targetUrl/', | |
// data: {param1: 'value1'}, | |
dataType: 'jsonp', | |
}).promise(); | |
}; | |
var outer = $.customMethod(); | |
outer.then(function(results){ | |
// console.log(results); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment