Difference between revisions of "MediaWiki:Common.js"

From UMaine SECS Numerical Modeling Laboratory
Jump to: navigation, search
 
(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. */
 
//$(function () {
 
//  var myElement = document.getElementById('displayText');
 
//  myElement.innerHTML = 'any HTML';
 
//}());
 
 
  
 
$(function () {
 
$(function () {
   formElement = document.getElementById("dropdown");
+
   var myElement = document.getElementById('displayText');
   var newInput = document.createElement("INPUT");
+
   myElement.innerHTML = 'any HTML';
  newInput.setAttribute("list", "viscosity");
+
}());
  formElement.appendChild(newInput);
 
  
  var newDataList = document.createElement("DATALIST");
+
mw.loader.load( '/w/index.php?title=MediaWiki:Md5.js&action=raw&ctype=text/javascript' );
  newDataList.setAttribute("id", "viscosity");
 
  document.getElementById("dropdown").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);
 
}());
 

Latest revision as of 01:31, 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';
}());

mw.loader.load( '/w/index.php?title=MediaWiki:Md5.js&action=raw&ctype=text/javascript' );