JavaScript

  1. Home
  2. Computing & Technology
  3. JavaScript

Fireworks

3. Add to Your Page

clr gif
Join the Discussion

Questions? Comments?

More of this Feature

Introduction Obtain the Script

All that remains to be done now is to add the fireworks script into your web page. To do this we simply add the script code to your page by placing the following into the head section:

<script src="fireworks.js" type="text/javascript">
</script>

The script itself contains the code necessary to trigger the fireworks once the page finishes loading so there is no need to place anything else into your web page.

If you only want the fireworks to display for a limited time then simply change the value assigned to "stopafter" at the top of the script. Any positive number in this field represents the number of minutes after which the fireworks display will stop if the page is still being viewed at that time. Zero in this field indicates that the display will continue for as long as the page is being viewed.

Sample Page | Obtain the Script | Add to Your Page

Explore JavaScript

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

JavaScript

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.