MediaWiki:Common.js
Förberedande kurs i matematik 1
(Skillnad mellan versioner)
(Ny sida: - →JavaScript som skrivs här körs varje gång en användare laddar en sida. - alert('test');) |
|||
Rad 1: | Rad 1: | ||
- | /* JavaScript | + | /* |
+ | Credit to John Resig for this function | ||
+ | taken from Pro JavaScript techniques | ||
+ | */ | ||
+ | function next(elem) { | ||
+ | do { | ||
+ | elem = elem.nextSibling; | ||
+ | } while (elem && elem.nodeType != 1); | ||
+ | return elem; | ||
+ | } | ||
- | + | function rm_next() { | |
+ | var elem = document.getElementById('ca-nstab-mediawiki'); | ||
+ | if (!elem) return; | ||
+ | var nextElem = next(elem); | ||
+ | if (nextElem) | ||
+ | nextElem.style.display = 'none'; | ||
+ | } | ||
+ | |||
+ | addOnloadHook(rm_next); |
Versionen från 10 april 2010 kl. 17.11
/*
Credit to John Resig for this function taken from Pro JavaScript techniques
- /
function next(elem) {
do { elem = elem.nextSibling; } while (elem && elem.nodeType != 1); return elem;
}
function rm_next() {
var elem = document.getElementById('ca-nstab-mediawiki'); if (!elem) return; var nextElem = next(elem); if (nextElem) nextElem.style.display = 'none';
}
addOnloadHook(rm_next);