JavaScript

function getQueryString()
{
    var queryString= [];
    var hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        queryString.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return queryString;
}

jQuery

var queries = {};
$.each(document.location.search.substr(1).split('&amp;'), function(c,q){
	var i = q.split('=');
	queries[i[0].toString()] = i[1].toString();
});

Purl (JavaScript URL parsing script)

$.url().param('search');


To use the Purl method you also need this nifty little script… https://github.com/allmarkedup/purl

0 0 votes
Article Rating
in JavaScript, jQuery
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments