This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 8th, 2013  |  syntax: JavaScript  |  size: 0.28 KB  |  views: 40  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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.         }
clone this paste RAW Paste Data