To get the query string parameter in a sharepoint page using javascript, below is the code snippet.
// call the EnsureSetup method
JSRequest.EnsureSetup();
// get the querystring parameter named empid e.g ...\test.aspx?empid=55&empname=sam
var empid = JSRequest.QueryString["empid"];
var empname = JSRequest.QueryString["empname"];
***********************************************************************
Output : empid = 55 and empname = Sam
***********************************************************************
Author: Samarendra Swain