From kodeboard, 4 Years ago, written in JavaScript.
Embed
  1. function getParameterByName(name) {
  2.     name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  3.     var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
  4.         results = regex.exec(location.search);
  5.     return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
  6. }
  7.  

You must login to reply or comment on this code.