Difference between revisions of "MediaWiki:Common.js"
From mispar
(Created page with "→Any JavaScript here will be loaded for all users on every page load.: console.log("test");") |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
− | + | ||
+ | |||
+ | const re = /#(.*)$/; | ||
+ | |||
+ | found = re.exec(window.location.href); | ||
+ | if (found) { | ||
+ | var id = found[1]; | ||
+ | var elem = document.getElementById(id); | ||
+ | if (elem) { | ||
+ | elem.style.backgroundColor = 'yellow'; | ||
+ | } | ||
+ | } |
Latest revision as of 21:57, 4 March 2022
/* Any JavaScript here will be loaded for all users on every page load. */ const re = /#(.*)$/; found = re.exec(window.location.href); if (found) { var id = found[1]; var elem = document.getElementById(id); if (elem) { elem.style.backgroundColor = 'yellow'; } }