Return to Snippet

Revision: 65323
at November 19, 2013 20:02 by gromitski


Initial Code
function getParameterByName(name) {
   var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
   return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}

Initial URL
http://gromitski.com/blog/get-variables-in-javascript/

Initial Description
Function enables the reading of url appended variables. See URL for more information.

Initial Title
Reading GET variables in Javascript

Initial Tags
url, javascript

Initial Language
JavaScript