193Chapter 14Document Object Model Essentialsfunction imageOn(imgName) { if (document.images) { document.images[imgName].src = onImages[imgName].src; } } The same goes for script statements in the Head that precache the swappable images as thepage loads: if (document.images) { var onImages = new Array(); onImages[ home ] = new Image(50,30); onImages[ home ].src = images/homeOn.gif ; … } This scenario can also provide added content on the page for scriptable browser users byembedding scripts within the body that use document.write()to generate content as thepage loads. For example, the page can begin with a time-sensitive greeting ( Good Morning, Good Afternoon, and so on), while nonscriptable browser users see a standard greetinginside the
This entry was posted
on Monday, October 1st, 2007 at 3:19 am and is filed under Tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.