Skip to content

Instantly share code, notes, and snippets.

View vaseker's full-sized avatar

Dmitry Vasilyev vaseker

View GitHub Profile
@vaseker
vaseker / parse_query
Last active August 29, 2015 14:19 — forked from maxvipon/parse_query
Добавлена сборка массива параметров. ex: ?param=foo&param=bar -> param: ['foo', 'bar']
var deserializeQuery = function () {
return location.search.substr(1)
.split('&')
.map(function (pair) {
pair = pair.split('=');
try {
pair[1] = pair[1] !== undefined ? decodeURIComponent(pair[1]) : true;
if (typeof pair[1] === 'string') {
pair[1] = pair[1].replace(/\+/g, ' ');
}