[code=html]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”
xml:lang=”en”>
<head>
<title>::GUEST BOOK::</title>
<script type=”text/javascript”
language=”JavaScript 2.1″>
<!–
function main()
/**************************************
TITLE: Arrays Lab
AUTHOR: David W. Kelley (DWK)
CREATE DATE: October 25, 2006
PURPOSE: Display knowledge of arrays and compile the array data into a displayable form.
LAST MODIFIED ON: October 30, 2006
LAST MODIFIED BY: David W. Kelley (DWK)
MODIFICATION HISTORY:
Added webpage variable.
***************************************/
{
const STRDEFAULTTEXT = new String(“Type your answer here.”);
var GuestTotal = new Array();
var g = new Number(0);
var GuestNumber = new String();
var strQuestion = new String(“”);
var strGuestNames = new String(“”);
var strGuests = new String(“”);
var strOutputMsg = new String(“”);
do
{
strQuestion = “Good day! How many guests shall “;
strQuestion += “be attending.”;
GuestNumber = parseInt(window.prompt(strQuestion,”0″));
if(GuestNumber>10)
{
strOutputMsg = “My apologies. However, you ”
strOutputMsg += “cannot invite that many guests.”
window.alert(strOutputMsg);
}
}while(GuestNumber>10)
for(g=0;g<GuestNumber;g++)
{
strQuestion = “Wonderful! Now, then, please tell ”
strQuestion += “me the name of Guest #”
strQuestion += (g+1);
strQuestion += “.”;
GuestTotal = window.prompt(strQuestion,STRDEFAULTTEXT);
}
strOutputMsg = “Your guests are as follows:n”;
strOutputMsg += “#”;
strOutputMsg += strGuestTotal;
strWebpage = new Array(strOutputMsg);
window.document.write(strWebpage);
}//end main
// –>
</script>
</head>
<body onLoad=”javascript:main();”>
<h1 style=”text-align:center”>SCRIPT TITLE</h1>
<hr size=”2″
width=”85%” />
</body>
</html>
Okay, here’s the problem: I can get it to run in Mozilla Firefox fine.. except for the fact that ONLY the third name entry shows up.
I need to find a way to show all three names. I’d apprecitae any help thank you.