Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* <pre><nowiki> */// function getParameterMap(url): Parses a URL and extracts the query string parameters;// if no URL is provided, uses the current URL. Caches parsed parameters between invocations.vargetParameterMap=(function(){// URL parameters cache: key=url, value=paramMapvarurlParamMaps={};returnfunction(url){// If no URL is passed in, use the current page's URLif(!url){url=___location.href;}// If the parameters for this URL have already been parsed, return themif(urlParamMaps[url])returnurlParamMaps[url];// Set up a new map for the parameters to be parsedvarparamMap={};// Split the URL from the query stringvarsearch=url.split("?",2)[1];if(search){// Split query string on "&"varkvs=search.split("&");for(variinkvs){// Split each key-value pair on the equals signvarkv=kvs[i].split("=",2);varkey=kv[0];varvalue=decodeURIComponent(kv[1]);// On the first occurence of a key, seed an empty array into paramMapif(!paramMap[key]){paramMap[key]=[];}// Push the new value onto the value list for the key in paramMapparamMap[key].push(value);}}// Cache the paramMap to avoid parsing for all parameter requestsurlParamMaps[url]=paramMap;returnparamMap;};})();// function getParameterValues(key, url): Extracts the list of values for a particular key// from the given URL; if no URL is provided, uses the current URL.// Returns null if the parameter was not in the URL.functiongetParameterValues(key,url){returngetParameterMap(url)[key];}// function getParameterValues(key, url): Extracts the values for a particular key// from the given URL; if no URL is provided, uses the current URL.// If there is more than one value for the given key, the first value is returned.// Returns null if the parameter was not in the URL.functiongetParameter(key,url){varvalues=getParameterValues(key,url);returnvalues?values[0]:null;}// function getParameterNames(url): Extracts the list of parameter names// from the given URL; if no URL is provided, uses the current URL.functiongetParameterNames(url){varnames=[];for(varningetParameterMap(url)){names.push(n);}returnnames;}/* </nowiki></pre> */