Bug Tracker

Modify

Ticket #10533 (closed bug: invalid)

Opened 19 months ago

Last modified 19 months ago

ajaxPrefilter functions not executing in expected order

Reported by: js.luiten@… Owned by:
Priority: low Milestone: None
Component: ajax Version: 1.7b2
Keywords: Cc:
Blocking: Blocked by:

Description

Suppose you want to set a prefilter for ajax calls of all dataTypes, and after that only for some datatypes.

I expect the prefilters to run in the order I supply them, but prefilters with the dataTypes argument set run first.

jQuery.ajaxPrefilter(function(){
  console.log(1);
});

jQuery.ajaxPrefilter('text', function(){ // or any combination of dataTypes
  console.log(2)
});

// log:
// 2
// 1

Setting '*' as the dataType on the first function does not solve the problem. Instead you must manually enter all possible dataTypes: 'text html json xml script jsonp'

Change History

comment:1 Changed 19 months ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to ajax

The more specific filters get precedence.

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.