Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sample (context, data)
- {
- var deferred = $.Deferred();
- $.ajax({ success: function (newData) {
- deferred.resolveWith(context, newData);
- }});
- return deferred;
- }
- sample(this, data)
- .done(function(newData)
- {
- console.log(this, 'is in samecontext as this passed');
- });
Add Comment
Please, Sign In to add comment