MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
var hashParams = window.location.hash.substr(1).split('&'); // substr(1) to remove the `#` | var hashParams = window.location.hash.substr(1).split('&'); // substr(1) to remove the `#` | ||
for(var i = 0; i < hashParams.length; i++){ | for(var i = 0; i < hashParams.length; i++){ | ||
var p = hashParams[i].split('='); | var p = hashParams[i].split('='); | ||
alert(decodeURIComponent(p[1])); | |||
document.getElementById(p[0]).value = decodeURIComponent(p[1]);; | document.getElementById(p[0]).value = decodeURIComponent(p[1]);; | ||
} | } |
Revision as of 08:55, 24 September 2013
var hashParams = window.location.hash.substr(1).split('&'); // substr(1) to remove the `#` for(var i = 0; i < hashParams.length; i++){ var p = hashParams[i].split('='); alert(decodeURIComponent(p[1])); document.getElementById(p[0]).value = decodeURIComponent(p[1]);; }