Home > database >  Uncaught SyntaxError: Unexpected end of input on line 5
Uncaught SyntaxError: Unexpected end of input on line 5

Time:06-05

<!DOCTYPE html>
<html>
    <head>
        <title>gridbot demo</title>
        <script> src = "gridbot.js"></script>
    </head>

    <body>
        hello
        <script>
            alert('gridbot');
        </script>
    </body>
</html>;

I keep getting a syntax error around line 5? Was i supposed to create and close a funtion? im not sure.

CodePudding user response:

The error is thrown because you already closed your script tag. The line should be:

<script src="gridbot.js"></script>

Also, you should not put semicolons after HTML tags.

</html> <!-- no semicolon -->

CodePudding user response:

There is a surplus > after the opening script tag.

  • Related