JavaScript Editor Ajax toolkit     Ajax website 



Main Page

An else statement is missing a matching if statement. The if statement is followed by a statement or compound statement and subsequently followed by the optional else statement. That is the only context in which the else statement can appear.

A compound statement is explicitly surrounded with braces. The compiler ignores tabbing conventions, which help improve the readability of the code.

To correct this error

  1. Enclose the code that follows the if statement in braces.

  2. Add an if statement before the else statement.

See Also

Reference

if...else Statement

Concepts

Troubleshooting Your Scripts

Other Resources

JScript Reference



JavaScript Editor Ajax toolkit     Ajax website


©