mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Make sure that .html(Function) gets the correct previous value.
This commit is contained in:
parent
cc1a34852f
commit
8fa9e9d6d0
@ -196,6 +196,14 @@ jQuery.fn.extend({
|
|||||||
this.empty().append( value );
|
this.empty().append( value );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if ( jQuery.isFunction( value ) ) {
|
||||||
|
this.each(function(i){
|
||||||
|
var self = jQuery(this), old = self.html();
|
||||||
|
self.empty().append(function(){
|
||||||
|
return value.call( this, i, old );
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.empty().append( value );
|
this.empty().append( value );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user