Bug Tracker

Changes between Initial Version and Version 1 of Ticket #11476


Ignore:
Timestamp:
Mar 22, 2012, 9:23:52 AM (11 years ago)
Author:
jaubourg
Comment:

Works for me: http://jsfiddle.net/kQMyz/

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11476

    • Property Status changed from new to closed
    • Property Resolution changed from to worksforme
  • Ticket #11476 – Description

    initial v1  
    11When using $.ajax as a deferred, the context is lost when the deferred succeeds and does its callback. Consider the following code:
    2 
     2{{{
    33var context = { foo: "bar" };
    44$.when($.ajax({ url: "...", context: context })).then(function(args) {
    55  //Where is context gone?
    66});
    7 
     7}}}
    88At the point of the comment, there is no trace of the original context object. It seems lost. According to the documentation, it should be in args[0], but args is holding [ returned data, "success", jqXHR ].
    99