]> source.dussan.org Git - jquery.git/commitdiff
Removing the second capture group. After the changes suggested by Jeff Roberson,... 18/head
authorunknown <Igen005@.upcorp.ad.uprr.com>
Fri, 24 Sep 2010 14:37:03 +0000 (09:37 -0500)
committerunknown <Igen005@.upcorp.ad.uprr.com>
Fri, 24 Sep 2010 14:37:03 +0000 (09:37 -0500)
http://stackoverflow.com/questions/3771105/can-someone-tell-me-the-purpose-of-the-second-capture-group-in-the-jquery-rts-reg

src/ajax.js

index 9886fd70f9273cc7736df5ebe0c5c4cb8fb96e40..eebb81b24ed3ba315df4f48e64d26c1ea64fcb4e 100644 (file)
@@ -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 : "");