How to get the url parameters

How to get the url parameters

I need to get which all are the parameter in the current url

http://localhost:81/jq/app/?param1=value

Since my parameters changes every time, I need to get the parameters (not values of parameters)

Not am getting the fill url using the code

  var pathname = window.location;

How will I extract, which all are the parameters

Please help
Thanks for your help