git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added in support for .offset(Function).
[jquery.git]
/
src
/
manipulation.js
diff --git
a/src/manipulation.js
b/src/manipulation.js
index
730dfca
..
9ed22ba
100644
(file)
--- a/
src/manipulation.js
+++ b/
src/manipulation.js
@@
-173,7
+173,7
@@
jQuery.fn.extend({
html: function( value ) {
if ( value === undefined ) {
html: function( value ) {
if ( value === undefined ) {
- return this[0] ?
+ return this[0] && this[0].nodeType === 1 ?
this[0].innerHTML.replace(rinlinejQuery, "") :
null;
this[0].innerHTML.replace(rinlinejQuery, "") :
null;
@@
-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 {
this.empty().append( value );
}
} else {
this.empty().append( value );
}