git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed an issue with parentNode being accessed in attr() on disconnected DOM elements.
[jquery.git]
/
src
/
core.js
diff --git
a/src/core.js
b/src/core.js
index
186a216
..
6c439a5
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-266,6
+266,8
@@
jQuery.fn = jQuery.prototype = {
return this.prevObject || jQuery( [] );
},
return this.prevObject || jQuery( [] );
},
+ // For internal use only.
+ // Behaves like an Array's .push method, not like a jQuery method.
push: [].push,
find: function( selector ) {
push: [].push,
find: function( selector ) {
@@
-959,7
+961,7
@@
jQuery.extend({
// Safari mis-reports the default selected property of a hidden option
// Accessing the parent's selectedIndex property fixes it
// Safari mis-reports the default selected property of a hidden option
// Accessing the parent's selectedIndex property fixes it
- if ( name == "selected" )
+ if ( name == "selected" && elem.parentNode )
elem.parentNode.selectedIndex;
// If applicable, access the attribute via the DOM 0 way
elem.parentNode.selectedIndex;
// If applicable, access the attribute via the DOM 0 way