Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > Adobe Dreamweaver

  • Print
  • + Share This
Like this article? We recommend

How It Works

The image reference name (name = florida) is used by the JavaScript code reference (document.florida) to place the graphic into the dummy filename (key.jpg). The math statement generates a random number and then rounds up, and adds it to the name key.

For example, say the random number generator creates the number 4. That number is then added to the end of the name key (key4), and finally the .jpg extension is added, creating the filename key4.jpg. The reference name is then used to load the file called key4.jpg into the selected layer and display it in the visitor's browser window.

  • + Share This
  • 🔖 Save To Your Account