Definer en variabel i window, og lad være med at bruge den andre steder end inde i den klasse. Al den automatik Jave leverer til det må du erstatte med egen forståelse og selvdisciplin.
Hvis den skal tilgås via klassen kan du jo give den en get og en set funktion:
function addLeaf(...) { this.items[this.count] = new leafType(); this.items[this.count].parent = this; this.items[this.count].title = title; this.items[this.count].onClickEvent = onClick; this.items[this.count].id = ''; // <-- unikt id this.items[this.count++].contextMenu = contextMenu; this.setStaticX = new Function( "verdi", "window['staticX'] = verdi;" ); this.getStaticX = new Function( "return window.staticX;" return this.items[this.count-1]; }
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.