Hinweis: Leere nach dem Veröffentlichen den Browser-Cache, um die Änderungen sehen zu können.
- Firefox/Safari: Umschalttaste drücken und gleichzeitig Aktualisieren anklicken oder entweder Strg+F5 oder Strg+R (⌘+R auf dem Mac) drücken
- Google Chrome: Umschalttaste+Strg+R (⌘+Umschalttaste+R auf dem Mac) drücken
- Edge: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
var cookies=new mycookies();
function onload() {
makeHideable("p-search");
makeHideable("p-lang");
makeHideable("p-Mitmachen");
makeHideable("p-navigation");
makeHideable("p-tb");
makeHideable("p-cactions");
makeHideable("p-personal");
var smli = document.createElement("li");
var sma = document.createElement("a");
smli.appendChild(sma);
sma.innerHTML = "test";
sma.onclick = function() {
swapContent("moep", "buh!");
}
document.getElementById("p-personal").getElementsByTagName("ul")[0].appendChild(smli);
document.getElementById("p-personal").setAttribute("id", "p-personal2");
document.getElementById("p-cactions").setAttribute("id", "p-cactions2");
}
function swapContent(title, content) {
alert("hallo o.O");
document.getElementsByTagName("h1")[0].innerHTML=title;
document.getElementById("bodyContent").innerHTML=content;
}
function mycookies() {
var string=document.cookie;
var cookies = new Array();
if(string!=null) {
var sp = string.split("|");
for(a in sp) {
cookies[(sp[a].split(":")[0])] = (sp[a].split(":")[1]);
}}
this.set = function(key, value) {
cookies[key] = value;
document.cookie=this.toString();
}
this.get = function(key) {
return cookies[key];
}
this.toString = function() {
var string="";
for(i in cookies) {
string += (i+":"+cookies[i]+"|");
}
return string;
}
}
function makeHideable(id) {
if(document.getElementById(id)==null) return;
var id=id;
var div = document.getElementById(id).getElementsByTagName("div")[0]
var h = document.getElementById(id).getElementsByTagName("h5")[0];
h.onclick=function() {
if(div.style.display=="none") {
cookies.set(id+"_hide", "0");
div.style.display="";
} else {
cookies.set(id+"_hide", "1");
div.style.display="none";
}
}
if(cookies.get(id+"_hide")=="1") h.onclick()
}