aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2011-01-09 16:22:11 -0600
committerColin Snover <github.com@zetafleet.com>2011-01-09 16:22:11 -0600
commit4e86766d54a71263f8e7cbf2957405e12d9b8b36 (patch)
tree2cf4a737351332ec54cee07ec66e54e1bc55017e /src
parent1d1d4fe112c49cbd704d880b27cc646f2bfe1737 (diff)
downloadjquery-4e86766d54a71263f8e7cbf2957405e12d9b8b36.tar.gz
jquery-4e86766d54a71263f8e7cbf2957405e12d9b8b36.zip
Change embedded regexp to a variable (for #6876).
Diffstat (limited to 'src')
-rw-r--r--src/ajax.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ajax.js b/src/ajax.js
index dbea8d5d4..d570fcccb 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -11,6 +11,7 @@ var r20 = /%20/g,
rselectTextarea = /^(?:select|textarea)/i,
rts = /([?&])_=[^&]*/,
rurl = /^(\w+:)?\/\/([^\/?#:]+)(?::(\d+))?/,
+ rCRLF = /\r?\n/g,
// Slice function
sliceFunc = Array.prototype.slice,
@@ -107,9 +108,9 @@ jQuery.fn.extend({
null :
jQuery.isArray(val) ?
jQuery.map( val, function(val, i){
- return {name: elem.name, value: val.replace(/\r?\n/g, "\r\n")};
+ return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
}) :
- {name: elem.name, value: val.replace(/\r?\n/g, "\r\n")};
+ { name: elem.name, value: val.replace(rCRLF, "\r\n") };
}).get();
}
});