mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 09:44:56 -05:00
Ajax: Remove jsonp callbacks through "jQuery#removeProp" method
Fixes gh-2323 Closes gh-2464
This commit is contained in:
@@ -64,8 +64,14 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
|
||||
|
||||
// Clean-up function (fires after converters)
|
||||
jqXHR.always(function() {
|
||||
// Restore preexisting value
|
||||
window[ callbackName ] = overwritten;
|
||||
// If previous value didn't exist - remove it
|
||||
if ( overwritten === undefined ) {
|
||||
jQuery( window ).removeProp( callbackName );
|
||||
|
||||
// Otherwise restore preexisting value
|
||||
} else {
|
||||
window[ callbackName ] = overwritten;
|
||||
}
|
||||
|
||||
// Save back as free
|
||||
if ( s[ callbackName ] ) {
|
||||
|
||||
Reference in New Issue
Block a user