// Handle JSONP Parameter Callbacks
if ( s.dataType == "jsonp" ) {
if ( type == "GET" ) {
- if ( !s.url.match(jsre) )
- s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
- } else if ( !s.data || !s.data.match(jsre) )
+ if ( jsre.test( !s.url ) )
+ s.url += (/\?/.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+ } else if ( !s.data || !jsre.test(s.data) )
s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
s.dataType = "json";
}
// Build temporary JSONP function
- if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
+ if ( s.dataType == "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
jsonp = "jsonp" + jsc++;
// Replace the =? sequence both in the query string and the data
// try replacing _= if it is there
var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
// if nothing was replaced, add timestamp to the end
- s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
+ s.url = ret + ((ret == s.url) ? (/\?/.test(s.url) ? "&" : "?") + "_=" + ts : "");
}
// If data is available, append data to url for get requests
if ( s.data && type == "GET" ) {
- s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
+ s.url += (/\?/.test(s.url) ? "&" : "?") + s.data;
}
// Watch for a new set of requests
if ( name in elem && notxml && !special ) {
if ( set ){
// We can't allow the type property to be changed (since it causes problems in IE)
- if ( name == "type" && elem.nodeName.match(/(button|input)/i) && elem.parentNode )
+ if ( name == "type" && /(button|input)/i.test(elem.nodeName) && elem.parentNode )
throw "type property can't be changed";
elem[ name ] = value;
var attributeNode = elem.getAttributeNode( "tabIndex" );
return attributeNode && attributeNode.specified
? attributeNode.value
- : elem.nodeName.match(/(button|input|object|select|textarea)/i)
+ : /(button|input|object|select|textarea)/i.test(elem.nodeName)
? 0
- : elem.nodeName.match(/^(a|area)$/i) && elem.href
+ : /^(a|area)$/i.test(elem.nodeName) && elem.href
? 0
: undefined;
}
// It's included for backwards compatibility and plugins,
// although they should work to migrate away.
browser: {
- version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
+ version: (/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/.exec(userAgent) || [0,'0'])[1],
safari: /webkit/.test( userAgent ),
opera: /opera/.test( userAgent ),
msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
}
return style.filter && style.filter.indexOf("opacity=") >= 0 ?
- (parseFloat( style.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
+ (parseFloat( /opacity=([^)]*)/.exec(style.filter)[1] ) / 100) + '':
"";
}
// IE uses filters for opacity
if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
- ret = (elem.currentStyle.filter || "").match(/opacity=([^)]*)/) ?
+ ret = /opacity=([^)]*)/.test(elem.currentStyle.filter || "") ?
(parseFloat(RegExp.$1) / 100) + "" :
"";
for ( var name in options )
elem.style[ name ] = old[ name ];
}
-});
\ No newline at end of file
+});
if ( /toggle|show|hide/.test(val) )
e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
else {
- var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
+ var parts = /^([+-]=)?([\d+-.]+)(.*)$/.exec(val),
start = e.cur(true) || 0;
if ( parts ) {
if ( typeof elem === "string" ) {
// Fix "XHTML"-style tags in all browsers
elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
- return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
+ return /^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i.test(tag) ?
all :
front + "></" + tag + ">";
});
!tags.indexOf("<leg") &&
[ 1, "<fieldset>", "</fieldset>" ] ||
- tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
+ /^<(thead|tbody|tfoot|colg|cap)/.test(tags) &&
[ 1, "<table>", "</table>" ] ||
!tags.indexOf("<tr") &&
// IE completely kills leading whitespace when innerHTML is used
if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) )
- div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
+ div.insertBefore( context.createTextNode( /^\s*/.exec(elem)[0] ), div.firstChild );
elem = jQuery.makeArray( div.childNodes );
}
"": function(checkSet, part, isXML){
var doneName = done++, checkFn = dirCheck;
- if ( !part.match(/\W/) ) {
+ if ( !/\W/.test(part) ) {
var nodeCheck = part = isXML ? part : part.toUpperCase();
checkFn = dirNodeCheck;
}
"~": function(checkSet, part, isXML){
var doneName = done++, checkFn = dirCheck;
- if ( typeof part === "string" && !part.match(/\W/) ) {
+ if ( typeof part === "string" && !/\W/.test(part) ) {
var nodeCheck = part = isXML ? part : part.toUpperCase();
checkFn = dirNodeCheck;
}
PSEUDO: function(match, curLoop, inplace, result, not){
if ( match[1] === "not" ) {
// If we're dealing with a complex expression, or a simple one
- if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) {
+ if ( chunker.exec(match[3]).length > 1 || /^\w/.test(match[3]) ) {
match[3] = Sizzle(match[3], null, null, curLoop);
} else {
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);