Skip to main content

Bug Tracker

Side navigation

#5654 closed bug (fixed)

Opened December 14, 2009 05:47AM UTC

Closed December 17, 2009 08:02PM UTC

Ajax callbacks and the this keyword

Reported by: IvanTheBearable Owned by:
Priority: minor Milestone: 1.4
Component: ajax Version: 1.4a1
Keywords: callback Cc:
Blocked by: Blocking:
Description

Ajax callbacks have been changed to something along these lines:

s.success.call( callbackContext, data, status, xhr );

where callbackContext can be defined with a new "context" property of the ajax options.

In general, this is great. However, if a context is not specified, it defaults to window. In 1.3 the context of an ajax callback was the options object itself. It is documented like this:

=

function (data, textStatus) {

data could be xmlDoc, jsonObj, html, text, etc...

this; the options for this ajax request

}

=

This is likely to break a lot of existing code. Perhaps defaulting the callbackContext to the options object would be better.

Cheers

Ivan

Attachments (0)
Change History (2)

Changed December 15, 2009 02:48AM UTC by dmethvin comment:1

need: ReviewCommit
priority: majorminor

Changed December 17, 2009 08:02PM UTC by john comment:2

resolution: → fixed
status: newclosed