// Is it a simple selector
isSimple = /^.[^:#\[\.]*$/,
// Is it a simple selector
isSimple = /^.[^:#\[\.]*$/,
jQuery.inArray(this.name, value) >= 0);
else if ( jQuery.nodeName( this, "select" ) ) {
jQuery.inArray(this.name, value) >= 0);
else if ( jQuery.nodeName( this, "select" ) ) {
jQuery( "option", this ).each(function(){
this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
jQuery( "option", this ).each(function(){
this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
// Remove any inner scripts for later evaluation
if ( elem.nodeType == 1 )
scripts = scripts.add( jQuery( "script", elem ).remove() );
// Remove any inner scripts for later evaluation
if ( elem.nodeType == 1 )
scripts = scripts.add( jQuery( "script", elem ).remove() );
- if ( deep && copy && typeof copy == "object" && src && !copy.nodeType )
- target[ name ] = jQuery.extend( deep, src, copy );
+ if ( deep && copy && typeof copy == "object" && !copy.nodeType )
+ target[ name ] = jQuery.extend( deep,
+ // Never move original objects, clone them
+ src || ( copy.length != null ? [ ] : { } )
+ , copy );
};
var expando = "jQuery" + now(), uuid = 0, windowData = {},
};
var expando = "jQuery" + now(), uuid = 0, windowData = {},
// See test/unit/core.js for details concerning this function.
isFunction: function( fn ) {
return !!fn && typeof fn != "string" && !fn.nodeName &&
// See test/unit/core.js for details concerning this function.
isFunction: function( fn ) {
return !!fn && typeof fn != "string" && !fn.nodeName &&
- head.appendChild( script );
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709).
+ head.insertBefore( script, head.firstChild );
},
prop: function( elem, value, type, i, name ) {
},
prop: function( elem, value, type, i, name ) {
- // Handle executable functions
- if ( jQuery.isFunction( value ) )
- value = value.call( elem, i );
-
- // Handle passing in a number to a CSS property
- return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ?
- value + "px" :
- value;
+ // Handle executable functions
+ if ( jQuery.isFunction( value ) )
+ value = value.call( elem, i );
+
+ // Handle passing in a number to a CSS property
+ return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ?
+ value + "px" :
+ value;
has: function( elem, className ) {
return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
}
has: function( elem, className ) {
return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
}
- // getComputedStyle is cached
- var ret = getComputedStyle( elem, null );
+ // defaultView is cached
+ var ret = defaultView.getComputedStyle( elem, null );
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
jQuery.each(elems, function(i, elem){
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
jQuery.each(elems, function(i, elem){
// Convert html string into DOM nodes
if ( typeof elem == "string" ) {
// Fix "XHTML"-style tags in all browsers
// Convert html string into DOM nodes
if ( typeof elem == "string" ) {
// Fix "XHTML"-style tags in all browsers
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
if ( set ){
// We can't allow the type property to be changed (since it causes problems in IE)
if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
if ( set ){
// We can't allow the type property to be changed (since it causes problems in IE)
if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
// convert the value to a string (all browsers do this but IE) see #1070
elem.setAttribute( name, "" + value );
// convert the value to a string (all browsers do this but IE) see #1070
elem.setAttribute( name, "" + value );
- if ( msie && special && notxml )
- return elem.getAttribute( name, 2 );
-
- return elem.getAttribute( name );
+ var attr = msie && notxml && special
+ // Some attributes require a special call on IE
+ ? elem.getAttribute( name, 2 )
+ : elem.getAttribute( name );
merge: function( first, second ) {
// We have to loop this way because IE & Opera overwrite the length
// expando of getElementsByTagName
merge: function( first, second ) {
// We have to loop this way because IE & Opera overwrite the length
// expando of getElementsByTagName
// Also, we need to make sure that the correct elements are being returned
// (IE returns comment nodes in a '*' query)
if ( jQuery.browser.msie ) {
// Also, we need to make sure that the correct elements are being returned
// (IE returns comment nodes in a '*' query)
if ( jQuery.browser.msie ) {
- for ( ; second[ i ]; i++ )
- if ( second[ i ].nodeType != 8 )
- first.push( second[ i ] );
+ while ( elem = second[ i++ ] )
+ if ( elem.nodeType != 8 )
+ first[ pos++ ] = elem;
+
+// Helper function used by the dimensions and offset modules
+function num(elem, prop) {
+ return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
+}