git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
215aab2
)
Fix for jQuery.clean that caused Safari to crash with newline characters
author
Brandon Aaron
<brandon.aaron@gmail.com>
Wed, 25 Oct 2006 14:05:25 +0000
(14:05 +0000)
committer
Brandon Aaron
<brandon.aaron@gmail.com>
Wed, 25 Oct 2006 14:05:25 +0000
(14:05 +0000)
src/jquery/jquery.js
patch
|
blob
|
history
diff --git
a/src/jquery/jquery.js
b/src/jquery/jquery.js
index
3816296
..
9561ea9
100644
(file)
--- a/
src/jquery/jquery.js
+++ b/
src/jquery/jquery.js
@@
-1565,10
+1565,13
@@
jQuery.extend({
// Go to html and back, then peel off extra wrappers
div.innerHTML = wrap[1] + s + wrap[2];
while ( wrap[0]-- ) div = div.firstChild;
// Go to html and back, then peel off extra wrappers
div.innerHTML = wrap[1] + s + wrap[2];
while ( wrap[0]-- ) div = div.firstChild;
- arg = div.childNodes;
- }
-
- if ( arg.length != undefined && !arg.nodeType ) // Handles Array, jQuery, DOM NodeList collections
+
+ // Have to loop through the childNodes here to
+ // prevent a Safari crash with text nodes and /n characters
+ for ( var j = 0; j < div.childNodes.length; j++ )
+ r.push( div.childNodes[j] );
+ }
+ else if ( arg.length != undefined && !arg.nodeType ) // Handles Array, jQuery, DOM NodeList collections
for ( var n = 0; n < arg.length; n++ )
r.push(arg[n]);
else
for ( var n = 0; n < arg.length; n++ )
r.push(arg[n]);
else