Skip to content

Instantly share code, notes, and snippets.

@biboletin
Last active March 1, 2018 09:08
Show Gist options
  • Save biboletin/d0f0c4d4541465b8cd6dc0397fc2dfe8 to your computer and use it in GitHub Desktop.
Save biboletin/d0f0c4d4541465b8cd6dc0397fc2dfe8 to your computer and use it in GitHub Desktop.
/*global browser, window, body, document, alert */
var URL = (function () {
"use strict";
var url = window.location.href;
var params = url.split("?");
var keyValues = params[1].split("&");
var objectArray = {};
var keys;
var part;
for (keys in keyValues) {
part = keyValues[keys].split("=");
objectArray[part[0]] = decodeURIComponent(part[1]);
}
return objectArray;
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment