PDA

View Full Version : problem with script :P


vkidv
09-05-2002, 06:17 PM
im quite new to actually 'writin scripts' and is wondering what is wrong with mine -
my bet is a wrong } or {

here is the script:

<html>
<script>
alert("hi, im rob!")
talk=confirm("do you want to talk to me?")
if (talk==false) {
alert("ok, bye")
}
if (talk == true) {
name=prompt("whats your name?","type ur name in here");
if (name==null || (name=="") {
name="web-surfer";
}}
alert("hello "+name+"!")
hobone=confirm("do you like javascripts? "+name+"?")
if (hobone==false) {
alert("you shouod, they are really cool "+name+"..")
} }
if (hobone==true) {
alert("me to "+name+" its really cool!")
gosite=confirm("hey if you like javascripts, want to go to a very cool website?")
if (gosite==true) {
window.open("http://www.dynamicdrive.com/")
}
if (gosite==false) {
alert("nevermind "+name+"!")
}}
</script>
</html>

Vladdy
09-05-2002, 06:51 PM
Here is one:

Originally posted by vkidv
im quite new to actually 'writin scripts' and is wondering what is wrong with mine -
my bet is a wrong } or {

here is the script:

<html>
<script>
alert("hi, im rob!")
talk=confirm("do you want to talk to me?")
if (talk==false) {
alert("ok, bye")
}
if (talk == true) {
name=prompt("whats your name?","type ur name in here");
if (name==null || (name=="") {
name="web-surfer";
}}
alert("hello "+name+"!")
hobone=confirm("do you like javascripts? "+name+"?")
if (hobone==false) {
alert("you shouod, they are really cool "+name+"..")
} }
if (hobone==true) {
alert("me to "+name+" its really cool!")
gosite=confirm("hey if you like javascripts, want to go to a very cool website?")
if (gosite==true) {
window.open("http://www.dynamicdrive.com/")
}
if (gosite==false) {
alert("nevermind "+name+"!")
}}
</script>
</html>

vkidv
09-05-2002, 07:02 PM
you mean that ( should not be there?)
:confused: :confused: :confused: :confused:

duniyadnd
09-05-2002, 08:31 PM
There were two errors from what I encountered.

Line 10 and Line 17. On line 10, all you have to do is fix the "if statement" syntax.

Instead, write it like this:

if ((name==null) || (name==""))

on Line 17 you had an extra curly braket, remove that.

(link 16 is:

alert("you shouod, they are really cool "+name+"..")

)


Remove ONE curly bracket after that.

Duniyadnd