Skip to content

Instantly share code, notes, and snippets.

View AndreiIgna's full-sized avatar
yes

Andrei AndreiIgna

yes
View GitHub Profile
@AndreiIgna
AndreiIgna / js-helper.js
Created March 1, 2011 20:14
js helpers
Rkm = window['Rkm'] || {};
Rkm.get_param = function(name) {
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match ? decodeURIComponent(match[1].replace(/\+/g, ' ')) : null;
}
Rkm.parse_str = function(s) {
var rv = {}, decode = window.decodeURIComponent || window.unescape;
(s == null ? location.search : s).replace(/^[?#]/, "").replace(/([^=&]*?)((?:\[\])?)(?:=([^&]*))?(?=&|$)/g, function ($, n, arr, v) {