It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Help!!!!

Help!!!!

Postby Pavanne on Thu Sep 28, 2006 12:00 pm

Before I go mad with frustration, can anybody please tell me why the function in the following script does not work?

<html>
<head>
<title>Function Calling</title>
<script language="javascript" type="text/javascript">
function saySomething(message) {
alert(message)
}
</script>
</head>

<body>
<h2>Animal Sounds</h2>
<hr/>

<form action ="#">
<input type="button" value="Cow" onclick="saySomething('moo')" />
<input type="button" value="Sheep" onclick="saySomething('Baa')" />
<input type="button" value="Dog" onclick="saySomething('Woof')" />
<input type="button" value="Duck" onclick="saySomething('Quack')" />
<input type="button" value="Cat" onclick="saySomething('meow')" />
</form>

</body>
</html>
Last edited by Pavanne on Fri Sep 29, 2006 11:51 pm, edited 1 time in total.
Pavanne
 
Posts: 10
Joined: Sun Sep 24, 2006 9:16 pm

Postby Pavanne on Fri Sep 29, 2006 11:43 pm

Can anybody help me with this, please?

I'm getting error messages to say the animal sounds are undefined.

How do I define them?

The "moo" sound seems to work, but I can't see the difference in the scripting between that and the other animal sounds.

Any thoughts appreciated.

Thanks.
Pavanne
 
Posts: 10
Joined: Sun Sep 24, 2006 9:16 pm

Postby Pavanne on Sat Sep 30, 2006 12:18 pm

For some unknown reason it now works!!!

I have changed nothing.

Oh well. :lol:
Pavanne
 
Posts: 10
Joined: Sun Sep 24, 2006 9:16 pm


Who is online

Users browsing this forum: No registered users and 5 guests