plany.js:
var plans=new Array(); var ile=0; function plany(){ function _start(klasa){ document.write(klasa); } this.start = _start; this.end=_end; function _pole(tresc){ document.write(tresc); } this.pole=_pole; this.plan=_plan; } menu = new plany() function plan(nr){ document.getElementById('tresc').innerHTML=plans[nr]; }
menu.js:
menu.start('Start '); menu.plan('cos','tam'); menu.plan('gdzies','tam'); menu.end();
i kod html:
Rzecz w tym ze skrypt pod IE wogole nie dziala, natomiast w Firefoxie dziala pieknie.