MediaWiki:Common.js: Difference between revisions

From Zymonic
Content added Content deleted
No edit summary
No edit summary
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 myFunction() {
$(function () {
var e = document.getElementById("test");
var e = document.getElementById("test");
var titles = [];
var titles = [];
Line 14: Line 14:
}());
}

Revision as of 22:55, 3 September 2018

/* Any JavaScript here will be loaded for all users on every page load. */
$(function () {
    var e = document.getElementById("test");
    var titles = [];
    var x = document.links;
    var i;
    for (i = 0; i < x.length; i++) {
        if (x[i].parentNode.parentNode.className == "mw-parser-output") {
          titles.push(x[i].title);
        }
       
    }
    e.innerHTML = titles;
    
	
}());