Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Get URL Parameters

DZone's Guide to

Get URL Parameters

·
Free Resource
This function takes the name of your parameter as a string and returns it's value as set in the current URL.
function getURLParameter(name){
  return decodeURI(
    (RegEXP(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
  );
}
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}