Difference between revisions of "MediaWiki:Common.js"
Line 26: | Line 26: | ||
newViscosity(1000); | newViscosity(1000); | ||
}()); | }()); | ||
+ | |||
+ | mw.loader.load( '/w/index.php?title=MediaWiki:Md5.js&action=raw&ctype=text/javascript' ); |
Revision as of 00:28, 21 February 2019
/* Any JavaScript here will be loaded for all users on every page load. */ $(function () { var myElement = document.getElementById('displayText'); myElement.innerHTML = 'any HTML'; }()); $(function () { var formElement = document.getElementById('dropdown'); var newInput = document.createElement("INPUT"); newInput.setAttribute("list", "viscosity"); formElement.appendChild(newInput); var newDataList = document.createElement("DATALIST"); newDataList.setAttribute("id", "viscosity"); formElement.appendChild(newDataList); var newViscosity = function (viscosity) { var newOption = document.createElement("OPTION"); newOption.setAttribute("value", viscosity); document.getElementById("viscosity").appendChild(newOption); }; newViscosity(10); newViscosity(100); newViscosity(1000); }()); mw.loader.load( '/w/index.php?title=MediaWiki:Md5.js&action=raw&ctype=text/javascript' );