Bug Tracker

Ticket #1026 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

isFunction with recursive ajax request

Reported by: teemow Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.1.3 Component: core
Version: 1.1.2 Keywords:
Cc: Needs:

Description

If I use the short version of jQuery.get (second parameter is callback function) recursively, the second request gets an object as get parameter which is the response of the first request.

This is caused by isFunction. It checks typeof fn[0] == 'undefined' which is false in case of the second request.

I found this error in firefox 2.0.0.2 on linux.

To reproduce try this:

callme = function(response, callback){
    var fn = function(response){
        callback(response);
    };
    console.dir(fn[0]);
    $.getJSON('/test/', fn);
};
callme({empty:true}, function(response){
    callme(response, function(){
        console.log('done');
    });
});

The second request looks like this:

GET http://localhost/test/?prototype=%5Bobject%20Object%5D

Attachments

Change History

Changed 2 years ago by john

  • status changed from new to closed
  • resolution set to fixed
  • component changed from ajax to core

Fixed in SVN rev [1535].

Note: See TracTickets for help on using tickets.