I
imaband
Hi,
I've got a little Quizzer program that asks a question in the upper
frame of a frameset and then lists the answer in the lower frame.
Answers can be plain text, straight html, a sound, or a LINK. I have a
function that builds the answer frame using document.write(among other
things). This code works fine until you encounter a link. It dutifully
displays the link in the lower frame but the very next question builds
the newContent perfectly but does NOT write it to the frame even
though it appears to execute it. Anybody know why?
JS
if (answerType == "link")
{
parent.frames[1].location = URL;
} else {
// pitiful attempt to clear linked page
parent.frames[1].location.href = "QuizzerAnswer.htm";
var newContent = '<html><head><title>Quizzer Answer</title>'
newContent += '</head>';
newContent += '<body>';
if (answerType == "text" || answerType == "html") {
newContent += answerValue;
}
if (answerType == "sound") {
newContent += '<embed src="' + answerValue;
newContent += '" width="170" height="25" autostart="true">'
}
newContent += '</body>';
newContent += '</html>';
parent.frames[1].document.write(newContent);
parent.frames[1].document.close();
}
I've got a little Quizzer program that asks a question in the upper
frame of a frameset and then lists the answer in the lower frame.
Answers can be plain text, straight html, a sound, or a LINK. I have a
function that builds the answer frame using document.write(among other
things). This code works fine until you encounter a link. It dutifully
displays the link in the lower frame but the very next question builds
the newContent perfectly but does NOT write it to the frame even
though it appears to execute it. Anybody know why?
JS
if (answerType == "link")
{
parent.frames[1].location = URL;
} else {
// pitiful attempt to clear linked page
parent.frames[1].location.href = "QuizzerAnswer.htm";
var newContent = '<html><head><title>Quizzer Answer</title>'
newContent += '</head>';
newContent += '<body>';
if (answerType == "text" || answerType == "html") {
newContent += answerValue;
}
if (answerType == "sound") {
newContent += '<embed src="' + answerValue;
newContent += '" width="170" height="25" autostart="true">'
}
newContent += '</body>';
newContent += '</html>';
parent.frames[1].document.write(newContent);
parent.frames[1].document.close();
}