Mam taki skrypt:
plany.js:
  1. var plans=new Array(); var ile=0;
  2. function plany(){
  3. function _start(klasa){ document.write(klasa); }
  4. this.start = _start;
  5. function _end(){ document.write('<div id="legenda">Legenda</div>'); }
  6. this.end=_end;
  7. function _pole(tresc){ document.write(tresc); }
  8. this.pole=_pole;
  9. function _plan(class,zawartosc){ document.write('<a href="javascript:plan('+ile+')">'+class+'</a> '); plans[ile]=zawartosc; ile++; }
  10. this.plan=_plan;
  11. } menu = new plany()
  12. function plan(nr){ document.getElementById('tresc').innerHTML=plans[nr]; }

menu.js:
  1. menu.start('Start ');
  2. menu.plan('cos','tam');
  3. menu.plan('gdzies','tam');
  4. menu.end();

i kod html:
  1. <script src="plany.js">
  2. </script>
  3. </head>
  4. <div id="box">
  5. <script src="menu.js">
  6. </script>
  7. <div id="tresc">
  8. &nbsp;
  9. </div>
  10. plan(0);
  11. </script>
  12. </div>
  13. </body>
  14. </html>

Rzecz w tym ze skrypt pod IE wogole nie dziala, natomiast w Firefoxie dziala pieknie.