diff options
author | Urban Müller | 2007-03-13 14:16:08 +0000 |
---|---|---|
committer | Urban Müller | 2007-03-13 14:16:08 +0000 |
commit | 06c23df086d1ffd40cca4a8798d257763bb3958f (patch) | |
tree | b63bcef80d83d4a33b891ee3a839e1b244f93441 /itjs | |
parent | b70e73b777bb50be7d8c7a15ca826c1a7826744e (diff) | |
download | itools-06c23df086d1ffd40cca4a8798d257763bb3958f.tar.gz itools-06c23df086d1ffd40cca4a8798d257763bb3958f.tar.bz2 itools-06c23df086d1ffd40cca4a8798d257763bb3958f.zip |
it_url_encode
Diffstat (limited to 'itjs')
-rw-r--r-- | itjs/it.js | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -157,3 +157,13 @@ function it_set(dst, src) } } +/** + * Encodes arbitrary string for use in an url + * @param str string to be encoded + */ +function it_url_encode(str) +{ + var result = window.aaencodeURIComponent ? encodeURIComponent(str) : escape(str).replace(/\+/g, "%2B"); + + return result.replace(/%20/gi, "+").replace(/%2C/gi, ",").replace(/%28/gi, "(").replace(/%29/gi, ")"); +} |