Skip to content

Instantly share code, notes, and snippets.

@joshbuchea
Forked from bchapuis/decodeUrlParameter.js
Last active February 19, 2016 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshbuchea/065f746448d9621a227c to your computer and use it in GitHub Desktop.
Save joshbuchea/065f746448d9621a227c to your computer and use it in GitHub Desktop.
Replace the plus sign which encode spaces in GET parameters using javascript.
function decodeUrlParameter(str) {
return decodeURIComponent((str+'').replace(/\+/g, '%20'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment