I have a page that someone else developed and it has a problem with the navigation. First, here is the pertinent code...
// create array of all quiz pages in the entire quiz
var quiz = new Array()
quiz[0] = new quizPage("intro_home.htm")
quiz[1] = new quizPage("intro_q1.htm")
quiz[2] = new quizPage("intro_q2.htm")
quiz[3] = new quizPage("intro_q3.htm")
quiz[4] = new quizPage("intro_q4.htm")
quiz[5] = new quizPage("intro_q5.htm")
quiz[6] = new quizPage("intro_q6.htm")
quiz[7] = new quizPage("intro_q7.htm")
quiz

= new quizPage("intro_q8.htm")
quiz[9] = new quizPage("intro_q9.htm")
quiz[10] = new quizPage("intro_q10.htm")
quiz[11] = new quizPage("intro_sum.htm")
// navigate to next quiz page in sequence
function goNext() {
var currPage, i
for (i=0; i<(quiz.length-1); i++)
{
if (parent.main.location.href.indexOf(quiz[i].src) != -1)
{
parent.main.location.href = quiz[i+1].src
break
}
}
}
Problem is that when the intro_sum.htm page is displayed and the end user clicks on the next button (which kicks the gonext function into action), they get an error because parent.main.location.href is undefined. I tried simply putting a new line into the array to fix it, but that did not work and I even tried changing the if statement to an if else statement. Anyone have any ideas?
Thanks in advance for your assistance.
Clay Hess