Java Script issues.

newtechkhris

Beta member
Messages
1
I'm trying to add a scroll bar to this script so that I can have a pop up window within this quiz, but for some reason, when the window opens, it doesn't have a scroll bar in it. Can someone please take a look at this script and tell me what I'm missing?

Code:
[COLOR=#2A2A2A][FONT=Segoe UI]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[/FONT][/COLOR][URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/URL][COLOR=#2A2A2A][FONT=Segoe UI]">[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]<html xmlns="[URL="http://www.w3.org/1999/xhtml"]XHTML namespace[/URL]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="../stylesheet.css" rel="stylesheet" type="text/css" />
<SCRIPT LANGUAGE="JavaScript">[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! [URL="http://javascript.internet.com/"]http://javascript.internet.com[/URL] -->[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]<!-- Begin
var ans = new Array;
var done = new Array;
var yourAns = new Array;
var explainAnswer = new Array;[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]var score = 0;
ans[1] = "b";
ans[2] = "b";
ans[3] = "a";
ans[4] = "c";
ans[5] = "b";
ans[6] = "b";
ans[7] = "b";
ans[8] = "a";
ans[9] = "c";
ans[10] = "b";
ans[11] = "b";
ans[12] = "a";
ans[13] = "c";
ans[14] = "b";
ans[15] = "b";
ans[16] = "a";
ans[17] = "c";
ans[18] = "b";[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]explainAnswer[1]="The reason why Answer 1 is Blah Blah Blah";
explainAnswer[2]="The reason why Answer 2 is Blah Blah Blah";
explainAnswer[3]="The reason why Answer 3 is Blah Blah Blah";
explainAnswer[4]="The reason why Answer 4 is Blah Blah Blah";
explainAnswer[5]="The reason why Answer 5 is Blah Blah Blah";
explainAnswer[6]="The reason why Answer 1 is Blah Blah Blah";
explainAnswer[7]="The reason why Answer 2 is Blah Blah Blah";
explainAnswer[8]="The reason why Answer 3 is Blah Blah Blah";
explainAnswer[9]="The reason why Answer 4 is Blah Blah Blah";
explainAnswer[10]="The reason why Answer 5 is Blah Blah Blah";
explainAnswer[11]="The reason why Answer 1 is Blah Blah Blah";
explainAnswer[12]="The reason why Answer 2 is Blah Blah Blah";
explainAnswer[13]="The reason why Answer 3 is Blah Blah Blah";
explainAnswer[14]="The reason why Answer 4 is Blah Blah Blah";
explainAnswer[15]="The reason why Answer 5 is Blah Blah Blah";
explainAnswer[16]="The reason why Answer 1 is Blah Blah Blah";
explainAnswer[17]="The reason why Answer 2 is Blah Blah Blah";
explainAnswer[18]="The reason why Answer 3 is Blah Blah Blah";[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]function Engine(question, answer) {
yourAns[question]=answer;
}[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]function Score(){
var answerText = "How did you do?\n------------------------------------\n";
for(i=1;i<=18;i++){
   answerText=answerText+"\nQuestion :"+i+"\n";
  if(ans[i]!=yourAns[i]){
    answerText=answerText+"\nThe correct answer was "+ans[i]+"\n"+explainAnswer[i]+"\n";
  }
  else{
    answerText=answerText+" \nCorrect! \n";
    score++;
  }
}[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]answerText=answerText+"\n\nYour total score is : "+score+"\n";[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]//now score the user
answerText=answerText+"\nComment : ";
if(score<=0){
answerText=answerText+"You need to learn some more";
}
if(score>=1 && score <=10){
answerText=answerText+"bit more practice";
}
if(score>=3 && score <=16){
answerText=answerText+"doing ok";
}
if(score>18){
answerText=answerText+"You are one hot java babe!";
}[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]alert(answerText);[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]}
//  End -->
</script>[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]
</head>[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]<body>
<table width="735" border="0" align="center" cellpadding="2" cellspacing="2">
  <tr>
    <td width="761" height="200"><table width="100%" border="0" bordercolor="red">
      <tr>
        <td width="56%" valign="top"><p> </p></td>
        <td width="44%"><table width="100%" border="0" cellpadding="1" cellspacing="1" bordercolor="black">
          <tr>
            <td valign="top">
   <h3><br />
                  </h3></td>
          </tr>
          <tr>
            <td valign="top"><p> </p></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="red">
      <tr>
        <td width="73%" valign="top"><table width="100%" cellpadding="1" cellspacing="1" bordercolor="black">
          <tr>
            <td height="368" align="left" valign="top">
<DIV ALIGN="Left">
<h1>How well do you know us</h1>
<b>Test your knowledge and see how high you score!</b>
<hr>
<FORM>
<b>1. What is the name of the Java mascot?</b><br>
<input type=radio name="q1" value="a" onClick="Engine(1, this.value)">a) Luke<br>
<input type=radio name="q1" value="b" onClick="Engine(1, this.value)">b) Duke<br>
<input type=radio name="q1" value="c" onClick="Engine(1, this.value)">c) Nuke<br>
<input type=radio name="q1" value="d" onClick="Engine(1, this.value)">d) Sunny<p>
<b>2. Where is the best place to get Java software?</b><br>
<input type=radio name="q2" value="a" onClick="Engine(2, this.value)">a) From a can<br>
<input type=radio name="q2" value="b" onClick="Engine(2, this.value)">b) From [URL="http://java.sun.com/"]java.sun.com[/URL]<br>
<input type=radio name="q2" value="c" onClick="Engine(2, this.value)">c) You have to buy it from Microsoft<br>
<input type=radio name="q2" value="d" onClick="Engine(2, this.value)">d) From your local Star Bucks<p>
<b>3. A 'for' loop in Java looks like this....</b><br>
<input type=radio name="q3" value="a" onClick="Engine(3, this.value)">a) for(int i=0;i<5;i++){}<br>
<input type=radio name="q3" value="b" onClick="Engine(3, this.value)">b) for i=1 to 5 do<br>
<input type=radio name="q3" value="c" onClick="Engine(3, this.value)">c) repeat...until(i=5)<br>
<input type=radio name="q3" value="d" onClick="Engine(3, this.value)">d) FOR I:=5 DOWNTO 1 DO  <p>
<b>4. Which platform can not run Java.</b><br>
<input type=radio name="q4" value="a" onClick="Engine(4, this.value)">Linux<br>
<input type=radio name="q4" value="b" onClick="Engine(4, this.value)">Windows NT<br>
<input type=radio name="q4" value="c" onClick="Engine(4, this.value)">Commodore 64<br>
<input type=radio name="q4" value="d" onClick="Engine(4, this.value)">Apple Mac<p>
<b>5. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>6. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>7. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>8. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>9. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>10. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>11. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>12. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>13. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>14. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>15. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>16. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>17. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>
<b>18. 'JMF' stands for: </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">A pop group of the 90's who had the hit "Unbelievable"<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">Java Media Framework<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">Java Messaging Framework<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">Java Meditation Forum<p>[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]<CENTER>
<input type=button onClick="Score()" value="Well... How did I do?">
</CENTER>
</FORM>
</DIV>[/FONT][/COLOR]
[COLOR=#2A2A2A][FONT=Segoe UI]</td>
          </tr>
          <tr>
            <td><p> </p></td>
          </tr>
        </table></td>
        <td width="27%" valign="top"><table width="100%" border="0" cellpadding="1" cellspacing="1" bordercolor="black">
          <tr>
            <td height="204"><p> </p></td>
          </tr>
          <tr>
            <td valign="top">
              <p>Theanl you for visiting our website we look for to enjoying our love with each and everyone of you. Blah blah blah blah bnlahand somemore blah and thats how the blah continues to roll thank you bla hblah blah Blah blah blah blah bnlahand somemore blah and thats how the blah continues to roll thank you bla hblah blah Blah blah blah blah bnlahand somemore blah and thats how the blah continues to roll thank you bla hblah blah </p></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
[/FONT][/COLOR]
 
W3Schools is your best friend. Specifically take a look at the options property [scrollbars yes|no].

I have no idea whether you're using window.open or not in that code so if it doesn't work come back and let me know.
 
Back
Top Bottom