/ Published in: JavaScript
Usage:
URL: http://test.com/?test=true
var test = $_GET['test'];
URL: http://test.com/?test=true
var test = $_GET['test'];
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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]); }