mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
1 line
594 B
JavaScript
1 line
594 B
JavaScript
function Querystring(qs){this.params={};var query_string=window.location.search;if(qs==null)qs=query_string.substring(1,query_string.length);if(qs.length==0)return;qs=qs.replace(/\+/g," ");var args=qs.split("&");for(var i=0;i<args.length;i++){var pair=args[i].split("=");var name=decodeURIComponent(pair[0]);var value=pair.length==2?decodeURIComponent(pair[1]):name;this.params[name]=value}}Querystring.prototype.get=function(key,default_){var value=this.params[key];return value!=null?value:default_};Querystring.prototype.contains=function(key){var value=this.params[key];return value!=null}; |