Wednesday, 5 October 2011

Get Query String data in JavaScript


function GetQueryStringData(QryStrName)
{
      var url = window.location.search.substring(1);
      var url = url.split("&");
      for (var i=0; i<url.length; i++)
{
            var strVal = url[i].split("=");
            if (strVal[0] == QryStrName)
{
                  return strVal[1];
            }
      }
}

No comments:

Post a Comment