Return to Snippet

Revision: 28325
at August 6, 2010 04:37 by brandonjp


Updated Code
// thanks to Retrieve URL params with jQuery - jQuery - Snipplr Social Snippet Repository http://bit.ly/blNbaK
// thanks to JQuery HowTo: Get URL parameters & values with jQuery http://bit.ly/b9rj6I

// parse the URL into query strings
$.urlParam = function(name) {
	var results = new RegExp('[?&]' + name + '=([^&#]*)').exec(window.location.href);
	if (!results) {
		return 0;
	}
	return results[1] || 0;
}; // end urlParam setup

Revision: 28324
at July 7, 2010 03:50 by brandonjp


Initial Code
// parse the URL into query strings
$.urlParam = function(name) {
	var results = new RegExp('[?&]' + name + '=([^&#]*)').exec(window.location.href);
	if (!results) {
		return 0;
	}
	return results[1] || 0;
}; // end urlParam setup



Initial URL

                                

Initial Description

                                

Initial Title
jQuery urlParam - read URL parameters, query string

Initial Tags
url, js, textmate, jquery, query

Initial Language
jQuery