Skip to content

Instantly share code, notes, and snippets.

@bchapuis
Last active October 27, 2020 06:29
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bchapuis/5575512 to your computer and use it in GitHub Desktop.
Save bchapuis/5575512 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