MediaWiki:Common.js

From AoP Wiki
Revision as of 13:24, 18 October 2023 by Zmeja (talk | contribs) (Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: function myFunction() { var x, y, z, a, text, text2, text3; x = document.getElementById("numb").value; y = 250+(550+150*(x-2))*(x-1); z = 5+0.5*(x-1); a = 5+0.2*(x-1); text = y; text2 = z; text3 = a; document.getElementById("demo").innerHTML = text; document.getElementById("demo2").innerHTML = text2; document.getElementById("demo3").innerHTML = text3; } $(function () { if ($(...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* Any JavaScript here will be loaded for all users on every page load. */
function myFunction() {
  var x, y, z, a, text, text2, text3;

  x = document.getElementById("numb").value;
  y = 250+(550+150*(x-2))*(x-1);
  z = 5+0.5*(x-1);
  a = 5+0.2*(x-1);
  text = y; text2 = z; text3 = a;
  document.getElementById("demo").innerHTML = text;
  document.getElementById("demo2").innerHTML = text2;
  document.getElementById("demo3").innerHTML = text3;
}

$(function () {
  if ($('#ll55-wrapper').length) {
    document.getElementById('ll55-wrapper').innerHTML =
      '<p>Please input the current level:</p>' +
      '<input id="numb" type="number" style="width: 130px">' +
      '<button type="button" onclick="myFunction()">Submit</button>' +
      '<p><img src="Gold.png"> <a id="demo">250</a></p>' +
      '<p><a id="demo2">5</a>%</p>' +
      '<p><a id="demo3">5</a>%</p>';
  }
});