Welcome Guest [Log In] [Register]
Welcome to Gamers Unite Omega. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
  • Pages:
  • 1
  • 3
I hate JavaScript
Topic Started: Jan 16 2007, 02:54 PM (528 Views)
73h |_|53r|\
Member Avatar
4|\|0|\|\_/|\/|
Help me. I can't find what the hell IE is talking about when it says it expected an object at such and such a line. Here is the code:

Code:
 
<html>
<head>
<title> Cartoon Quiz </title>
<scirpt language="JavaScript">

<!-- This page receives an error mesage for each function attempted, "Object Expected", at the line of

code where a function attempted to execute. -->

<!-- hide

function scoreQuestions(number, answer) {
if (number == 1) {
 if (answer == 'b')
  alert("Correct Answer")
 else
  alert("Incorrect Answer")
}

else if (number == 2) {
 if (answer == 'c')
  alert("Correct Answer")
 else
  alert("Incorrect Answer")
}
else if (number == 3) {
 if (answer == 'd')
  alert("Correct Answer")
 else
  alert("Incorrect Answer")
}
else if (number == 4) {
 if (answer == 'c')
  alert("Correct Answer")
 else
  alert("Incorrect Answer")
}
else if (number == 5) {
 if (answer == 'a')
  alert("Correct Answer")
 else
  alert("Incorrect Answer")
}

stop hide -->
</script>
</head>


<body>
<h1> Cartoon Quiz</h1>
<P> Answer all of the questions on the quiz. </p>
<form>


<P><B>1. What is the name of Walt Disney's famous mouse?</B></P>
<P>
<input type="radio" name="question1" value="a"      

onClick="scoreQuestions(number, this.value)">Mighty Mouse<BR>
<input type="radio" name="question1" value="b"
 onClick="scoreQuestions(1, this.value)">Mickey Mouse<BR>
<input type="radio" name="question1" value="c"
 onClick="scoreQuestions(1, this.value)">Marty Mouse<BR>
<input type="radio" name="question1" value="d"
 onClick="scoreQuestions(1, this.value)">Melvin Mouse<BR>
</P>

<P><B>2. The character Buzz Lightyear was featured in which animated film?</B></P>
<P>
<input type="radio" name="question2" value="a"
 onClick="scoreQuestions(2, this.value)">Fantasia<BR>
<input type="radio" name="question2" value="b"
 onClick="scoreQuestions(2, this.value)">Hercules<BR>
<input type="radio" name="question2" value="c"
 onClick="scoreQuestions(2, this.value)">Toy Story<BR>
<input type="radio" name="question2" value="d"
 onClick="scoreQuestions(2, this.value)">Mulan<BR>
</P>

<P><B>3. Pluto is a dog. What is Goofy?</B></P>
<P>
<input type="radio" name="question3" value="a"
 onClick="scoreQuestions(3, this.value)">A bear<BR>
<input type="radio" name="question3" value="b"
 onClick="scoreQuestions(3, this.value)">A mule<BR>
<input type="radio" name="question3" value="c"
 onClick="scoreQuestions(3, this.value)">A horse<BR>
<input type="radio" name="question3" value="d"
 onClick="scoreQuestions(3, this.value)">Also a dog<BR>
</P>

<P><B>4. Who was always trying to eat Tweety Bird?</B></P>
<P>
<input type="radio" name="question4" value="a"
 onClick="scoreQuestions(4, this.value)">Porky Pig<BR>
<input type="radio" name="question4" value="b"
 onClick="scoreQuestions(4, this.value)">Yosemite Sam<BR>
<input type="radio" name="question4" value="c"
 onClick="scoreQuestions(4, this.value)">Sylvester<BR>
<input type="radio" name="question4" value="d"
 onClick="scoreQuestions(4, this.value)">Foghorn Leghorn<BR>
</P>

<P><B>5. What is Winnie the Pooh's favorite food?</B></P>
<P>
<input type="radio" name="question5" value="a"
 onClick="scoreQuestions(5, this.value)">Honey<BR>
<input type="radio" name="question5" value="b"
 onClick="scoreQuestions(5, this.value)">Molasses<BR>
<input type="radio" name="question5" value="c"
 onClick="scoreQuestions(5, this.value)">Peanut Butter<BR>
<input type="radio" name="question5" value="d"
 onClick="scoreQuestions(5, this.value)">Yogurt<BR>
</P>

</form>
</body>
</html>
Offline Profile Quote Post Goto Top
 
cloudst
Member Avatar
How troublesome...
You need a patch.
Offline Profile Quote Post Goto Top
 
Asazel2
Member Avatar
The Fallen
You have a head and a body, but you have no conclusion.
Offline Profile Quote Post Goto Top
 
izaboo
Member Avatar
Carl the MAN!
Fuck java script .. fuck it right in the ear
Offline Profile Quote Post Goto Top
 
Ad134
Member Avatar
Who ya gonna kill? KENNY!!!
You forgot this line:

Code:
 
// Screw this, who wants donuts?
Offline Profile Quote Post Goto Top
 
cloudst
Member Avatar
How troublesome...
All these are acceptable.
Offline Profile Quote Post Goto Top
 
73h |_|53r|\
Member Avatar
4|\|0|\|\_/|\/|
More like entirely irrelevant. Some fuck-heads you bunch are.
Offline Profile Quote Post Goto Top
 
Scathmere
Unregistered

Lol, :flamewar:
Quote Post Goto Top
 
Ad134
Member Avatar
Who ya gonna kill? KENNY!!!
*stabs user with a banana*
Offline Profile Quote Post Goto Top
 
cloudst
Member Avatar
How troublesome...
That's it?
Offline Profile Quote Post Goto Top
 
Ad134
Member Avatar
Who ya gonna kill? KENNY!!!
*takes out his insides using toothpicks, and while he's only just alive, i burn his organs*
Offline Profile Quote Post Goto Top
 
Paulus2
Member Avatar
LOL postwhore
I couldn't see the error. I don't know JavaScript though, just pure Java. And I don't know more than the basic stuff with that.

Come back to me in six months
Offline Profile Quote Post Goto Top
 
Asazel2
Member Avatar
The Fallen
Perhaps the problem isn't with the Java, but instead the problem is with YOU. :angry:
Offline Profile Quote Post Goto Top
 
Asazel2
Member Avatar
The Fallen
73h |_|53r|\
Jan 16 2007, 02:54 PM

<P><B>1. What is the name of Walt Disney's famous mouse?</B></P>
<P>
<input type="radio" name="question1" value="a"      

onClick="scoreQuestions(number, this.value)">Mighty Mouse<BR>
<input type="radio" name="question1" value="b"
 onClick="scoreQuestions(1, this.value)">Mickey Mouse<BR>
<input type="radio" name="question1" value="c"
 onClick="scoreQuestions(1, this.value)">Marty Mouse<BR>
<input type="radio" name="question1" value="d"
 onClick="scoreQuestions(1, this.value)">Melvin Mouse<BR>
</P>

*double post*

For everything else you place a number in the place where it says "number", so try replacing it with the actual number.
Offline Profile Quote Post Goto Top
 
73h |_|53r|\
Member Avatar
4|\|0|\|\_/|\/|
I found that before you mentioned it, but thanks for attempting at something useful.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
ZetaBoards - Free Forum Hosting
Join the millions that use us for their forum communities. Create your own forum today.
Learn More · Register Now
Go to Next Page
« Previous Topic · The Den · Next Topic »
Add Reply
  • Pages:
  • 1
  • 3

Bleet created by Zeus00 of the ZNR