Removing the second capture group. After the changes suggested by Jeff Roberson, the second capture group is no longer needed. See

http://stackoverflow.com/questions/3771105/can-someone-tell-me-the-purpose-of-the-second-capture-group-in-the-jquery-rts-reg
This commit is contained in:
unknown 2010-09-24 09:37:03 -05:00
parent 5c055040d3
commit a088751a1b

View file

@ -7,7 +7,7 @@ var jsc = jQuery.now(),
rbracket = /\[\]$/, rbracket = /\[\]$/,
jsre = /\=\?(&|$)/, jsre = /\=\?(&|$)/,
rquery = /\?/, rquery = /\?/,
rts = /([?&])_=[^&]*(&?)/, rts = /([?&])_=[^&]*/,
rurl = /^(\w+:)?\/\/([^\/?#]+)/, rurl = /^(\w+:)?\/\/([^\/?#]+)/,
r20 = /%20/g, r20 = /%20/g,
rhash = /#.*$/, rhash = /#.*$/,
@ -275,7 +275,7 @@ jQuery.extend({
var ts = jQuery.now(); var ts = jQuery.now();
// try replacing _= if it is there // try replacing _= if it is there
var ret = s.url.replace(rts, "$1_=" + ts + "$2"); var ret = s.url.replace(rts, "$1_=" + ts);
// if nothing was replaced, add timestamp to the end // if nothing was replaced, add timestamp to the end
s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : ""); s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");