faqts : Computers : Programming : Languages : JavaScript : DHTML

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

43 of 47 people (91%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

How can I load several layers in a row with NN4?

Feb 26th, 2000 08:42
Martin Honnen,


Although NN4 allows you to load an external html file into a 
layer/positioned element by setting
  document.layerName.src = 'url'
it seems to fail when you do that consecutively for several layers e.g.
  document.layerName1.src = 'url1';
  document.layerName2.src = 'url2';
The reason is that only one layer can be loading at a time and needs to 
finish loading before you start loading the next one. You can achieve 
that by chaining the layers load with the onload handler:
  document.layerName1.onload =
    function (evt) {
      document.layerName2.src = 'url2';
    };
  document.layerName2.onload =
    function (evt) {
      document.layerName3.src = 'url3';
    };
  document.layerName1.src = 'url1';