Bug Tracker

Ticket #3231: dataFilter[5810].diff

File dataFilter[5810].diff, 0.8 kB (added by flesler, 5 months ago)

This is the patch

  • src/ajax.js

     
    480480        if( s && s.dataFilter ) 
    481481            data = s.dataFilter( data, type ); 
    482482 
    483         // If the type is "script", eval it in global context 
    484         if ( type == "script" ) 
    485             jQuery.globalEval( data ); 
     483        // The filter can actually parse the response 
     484        if( typeof data == 'string' ){ 
    486485 
    487         // Get the JavaScript object, if JSON is used. 
    488         if ( type == "json" ) 
    489             data = eval("(" + data + ")"); 
     486           // If the type is "script", eval it in global context 
     487           if ( type == "script" ) 
     488               jQuery.globalEval( data ); 
    490489 
     490            // Get the JavaScript object, if JSON is used. 
     491            if ( type == "json" ) 
     492                data = eval("(" + data + ")"); 
     493        } 
     494         
    491495        return data; 
    492496    }, 
    493497