Simple JScript error 
Author Message
 Simple JScript error

Your IF has a semicolon in the wrong line

Not:

if(...);
...;

But:

if()     //  no semicolon here
...;

Quote:

> can anyone put a beginner out of his misery? I have this simple Java
> Script that IE keeps throwing back due to a syntax error.

> It is the 'else' statement that IE trips over.

> *****************
> <HTML>
> <HEAD>
> <TITLE>The log in screen</TITLE>
> </HEAD>
> <BODY>
> <SCRIPT LANGUAGE="JavaScript">

> var password

> password = prompt("Enter a Password","");

> if(password=="mamu");

> {
>  document.writeln("Correct,the monkey's name is "+ password);
> }
> else
> {
>   document.writeln("Sorry, incorrect");
> }

> </script>

> </BODY>
> </HTML>

> ***********************

> --
> Kind Regards

> Colin Reed





Sun, 15 Sep 2002 03:00:00 GMT  
 Simple JScript error
can anyone put a beginner out of his misery? I have this simple Java
Script that IE keeps throwing back due to a syntax error.

It is the 'else' statement that IE trips over.

*****************
<HTML>
<HEAD>
<TITLE>The log in screen</TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">

var password

password = prompt("Enter a Password","");

if(password=="mamu");

{
 document.writeln("Correct,the monkey's name is "+ password);

Quote:
}

else
{
  document.writeln("Sorry, incorrect");

Quote:
}

</script>

</BODY>
</HTML>

***********************

--
Kind Regards

Colin Reed




Mon, 16 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. This simple JScript is causing a runtime error

2. Even simpler JScript run time error

3. Simple JScript question

4. simple DateAdd function equivalent in JScript?

5. Simple string formating with JScript

6. Need help converting simple JScript to VBScript

7. ADO error error seems to have stopped (JScript) script with ERRORLEVEL=0

8. simple jscript example needed

9. Serialize/deserialize simple JScript objects

10. Why does this simple script give an error?

11. Simplest of programs gives error ';' expected

12. SIMPLE Update Query - Syntax Error!

 

 
Powered by phpBB® Forum Software