git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some missing braces in core.js.
[jquery.git]
/
src
/
core.js
diff --git
a/src/core.js
b/src/core.js
index
cb9b528
..
35cac37
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-20,7
+20,7
@@
var jQuery = function( selector, context ) {
// A simple way to check for HTML strings or ID strings
// (both of which we optimize for)
// A simple way to check for HTML strings or ID strings
// (both of which we optimize for)
- quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
+ quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
// Is it a simple selector
isSimple = /^.[^:#\[\.,]*$/,
// Is it a simple selector
isSimple = /^.[^:#\[\.,]*$/,
@@
-47,7
+47,9
@@
jQuery.fn = jQuery.prototype = {
var match, elem, ret;
// Handle $(""), $(null), or $(undefined)
var match, elem, ret;
// Handle $(""), $(null), or $(undefined)
- if ( !selector ) return this;
+ if ( !selector ) {
+ return this;
+ }
// Handle $(DOMElement)
if ( selector.nodeType ) {
// Handle $(DOMElement)
if ( selector.nodeType ) {
@@
-70,12
+72,14
@@
jQuery.fn = jQuery.prototype = {
// HANDLE: $("#id")
} else {
// HANDLE: $("#id")
} else {
- elem = document.getElementById( match[3] );
+ elem = document.getElementById( match[2] );
if ( elem ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem ) {
// Handle the case where IE and Opera return items
// by name instead of ID
- if ( elem.id !== match[3] ) return rootjQuery.find( selector );
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
// Otherwise, we inject the element directly into the jQuery object
this.length++;
// Otherwise, we inject the element directly into the jQuery object
this.length++;
@@
-313,7
+317,9
@@
jQuery.extend({
// check if an element is in a (or is an) XML document
isXMLDoc: function( elem ) {
// check if an element is in a (or is an) XML document
isXMLDoc: function( elem ) {
- return (elem.ownerDocument || elem).documentElement.nodeName !== "HTML";
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ return ((elem.ownerDocument || elem).documentElement || 0).nodeName !== "HTML";
},
// Evalulates a script in a global context
},
// Evalulates a script in a global context