Return to Snippet

Revision: 51313
at September 21, 2011 01:48 by uberdragon


Initial Code
var parts = window.location.search.substr(1).split("&");
var $_GET = {};
for (var i = 0; i < parts.length; i++) {
	var temp = parts[i].split("=");
	$_GET[decodeURIComponent(temp[0])] = decodeURIComponent(temp[1]);
}

Initial URL

                                

Initial Description
Usage:

URL: http://test.com/?test=true

var test = $_GET['test'];

Initial Title
php's $_GET in javascript

Initial Tags

                                

Initial Language
JavaScript