From: unknown Date: Fri, 24 Sep 2010 14:37:03 +0000 (-0500) Subject: Removing the second capture group. After the changes suggested by Jeff Roberson,... X-Git-Tag: 1.4.3rc1~42^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F18%2Fhead;p=jquery.git 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 --- diff --git a/src/ajax.js b/src/ajax.js index 9886fd70f..eebb81b24 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -7,7 +7,7 @@ var jsc = jQuery.now(), rbracket = /\[\]$/, jsre = /\=\?(&|$)/, rquery = /\?/, - rts = /([?&])_=[^&]*(&?)/, + rts = /([?&])_=[^&]*/, rurl = /^(\w+:)?\/\/([^\/?#]+)/, r20 = /%20/g, rhash = /#.*$/, @@ -275,7 +275,7 @@ jQuery.extend({ var ts = jQuery.now(); // 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 s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");