Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1026 closed bug (fixed)

isFunction with recursive ajax request

Reported by: teemow Owned by:
Priority: major Milestone: 1.1.3
Component: core Version: 1.1.2
Keywords: Cc:
Blocked by: Blocking:

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

Change History (1)

comment:1 Changed 13 years ago by john

Component: ajaxcore
Resolution: fixed
Status: newclosed

Fixed in SVN rev [1535].

Note: See TracTickets for help on using tickets.