Bug Tracker

Modify

Ticket #5654 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

Ajax callbacks and the this keyword

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

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

Change History

comment:1 Changed 4 years ago by dmethvin

  • need changed from Review to Commit
  • Priority changed from major to minor

comment:2 Changed 4 years ago by john

  • Status changed from new to closed
  • Resolution set to fixed

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.