...

View Full Version : nothins happenin



the_bob
01-16-2004, 01:07 AM
hey, i just made this script but it isn't working

<script>

var name=prompt("what's yo name?");
alert(name + "is a decent name, its almost as cool as Bob, but not quite);
alert("Sup " + name + "? It just doesn't have that ring to it...");
alert("Oh well...")

</script>

someone please help me

gingerGamgee
01-16-2004, 02:59 AM
just missed the " after quite

<html>
<title>test</title>

<script>

var name=prompt("what's yo name?");
alert(name + " is a decent name, its almost as cool as Bob, but not quite");
alert("Sup " + name + "? It just doesn't have that ring to it...");
alert("Oh well...")

</script>

</html>

DsgnrsTLZAdmin
01-16-2004, 03:20 AM
The script gingerGamgee gave you works fine but he forgot to add ; at the end of the last alert and script lang defier so here u go




<html>
<title>test</title>

<script language="javascript">

var name=prompt("what's yo name?");
alert(name + " is a decent name, its almost as cool as Bob, but not quite");
alert("Sup " + name + "? It just doesn't have that ring to it...");
alert("Oh well...");

</script>

</html>

the_bob
01-16-2004, 01:14 PM
thanks! I just get so mad when i mess up little things like that...

I just have one more question, when it asks your name it has "undefined" already in there, is there any way to remove that so it is just an empty box?

Choopernickel
01-16-2004, 03:01 PM
prompt("Question?", "Default answer.");

fredmv
01-16-2004, 03:13 PM
Originally posted by DsgnrsTLZAdmin
The script gingerGamgee gave you works fine but he forgot to add ; at the end of the last alertWhile it is a good practice to terminate statements with semicolons, it is not required in JavaScript (unless you have two statements on the same line, of course).

the_bob
01-16-2004, 10:51 PM
thanks again, everyone!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum