Posted By

gromitski on 11/19/13


get url javascript variable

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Reading GET variables in Javascript

 / Published in: JavaScript


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

  1. function getParameterByName(name) {
  2. var match = RegExp('[?&]' + name + '=([^&]*)').exec(;
  3. return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
  4. }

Report this snippet  

You need to login to post a comment.