1. Home
  2. Computing & Technology
  3. JavaScript

Analysis Quiz

3. Analysis Head Script

Once the last question has been answered the resulting value will be passed to the analysis page. The first step in setting up this page is add a script to the head of the page to retrieve the final result and convert it to a precentage.

To do this select the code from the text box below (there is a highlight all button beneath it to make this easier) and copy it into a file called quizresh.js.

You now add this script to the head section of the analysis page using the following code:

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

The final step in creating the analysis quiz is to create the body script for the analysis page that will display the appropriate result based on the percentage score achieved.

Quiz Head Script | Quiz Body Script | Analysis Head | Analysis Body
Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

  1. Home
  2. Computing & Technology
  3. JavaScript

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

All rights reserved.