previous

page 19

next

If you double-clicked on your new index.html, this is what you should see.

And if you now click on this link, you should be transported to your quiz program.

But! We need to be able to tell our quiz program which quiz to use!

It turns out to be very simple:

<a href='quiz.html?dir=Landmarks'>Quiz</a>

But! How does our quiz program grab this information?

By replacing the first line in globals.js with these three lines:

var g_params=location.search; // ?dir=Landmarks
var g_dir=g_params.substring(5); // Landmarks
if (g_params=='') g_dir='Movies';

Note the third line which ensures that if you double click on quiz.html, it will still work.

location.search will always contain the string from the ? onwards.

All that remains is to make index.html more attractive.

previous
next