YulongW
11/6/2014 - 8:01 PM

Get parameter from URL by their names

Get parameter from URL by their names

function getURLParameter(name) {
  return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null
}