jam-cloud/web/app/assets/javascripts/jquery.queryparams.js

14 lines
474 B
JavaScript
Raw Permalink Normal View History

2013-09-23 21:00:39 +00:00
// from http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values
(function($) {
$.QueryString = (function(a) {
if (a == "") return {};
var b = {};
for (var i = 0; i < a.length; ++i)
{
var p=a[i].split('=');
if (p.length != 2) continue;
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
}
return b;
})(window.location.search.substr(1).split('&'))
})(jQuery);