Code Snippet: How to get the value of a query string using the SPServices jQuery Library

Marc Anderson’s SPServices jQuery Library is a fantastic resource for the developer. Using his SPGetQueryString function, you can easily get the value of a query string parameter with only two lines of code:

var qsParams = $().SPServices.SPGetQueryString();
var qsValue = qsParams["ID"];

 The SPServices jQuery Library can be found on CodePlex.

(more…)

Code Snippet: How to read the value of a query string parameter using Javascript

//*** GET WEBID PARAMETER QUERY STRING VALUE
// example url: 'http://site/default.aspx?WebID=1234' 
function querySt(ji) {
    hu = window.location.search.substring(1);
    gy = hu.split("&");
    for (i = 0; i < gy.length; i++) {
        ft = gy[i].split("=");
        if (ft[0] == ji) {
            return ft[1];
        }
    }
}
var qsValue = querySt("WebID");  //returns '1234'

(more…)