[JAVASCRIPT] Get Parameter from url query string

/ Published in: JavaScript
Save to your folder(s)

Get Parameter from url query string

Copy this code and paste it in your HTML
  1. function getParameterByName(name) {
  2. var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
  3. return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
  4. }
  5. getParameterByName( "parameterName" )

URL: http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.