MediaWiki:Common.js: Difference between revisions

From Moonlight Design
Jump to navigation Jump to search
(New page: →‎Any JavaScript here will be loaded for all users on every page load.: // Highlight every other line in the software tables var orig_onload = window.onload; window.onload = function(e...)
 
No edit summary
Line 4: Line 4:
var orig_onload = window.onload;
var orig_onload = window.onload;
window.onload = function(e) {
window.onload = function(e) {
    alert(e);
     orig_onload(e);
     orig_onload(e);
     var tables = document.getElementsByTagName("table");
     var tables = document.getElementsByTagName("table");

Revision as of 03:36, 23 September 2007

/* Any JavaScript here will be loaded for all users on every page load. */

// Highlight every other line in the software tables
var orig_onload = window.onload;
window.onload = function(e) {
    alert(e);
    orig_onload(e);
    var tables = document.getElementsByTagName("table");
    var rows;
    for (var t = 0; t < tables.length; i++) {
        if (tables[t].className == "software") {
            rows = tables[t].rows;
            for (var r = 0; r < rows.length; i++) {
                if (r % 2 == 0) {
                    rows[t].className = "grayrow";
                }
            }
            alert("meow");
        }
    }
}