P
P
pmozil2018-02-16 23:01:52
css
pmozil, 2018-02-16 23:01:52

Why does Brackets throw an error 'alert' was used before it was defined?

I connect an external js file, I decided to check it and came across an unpleasant thing. I work in the Brackets editor.
HTML document code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test</title>
    <link rel="stylesheet" href="style.css">
    <script scr="js/script.js"></script>
</head>
<body>
   
</body>
</html>

JS code: And of course the alert doesn't work, I'm racking my brains, I don't understand what the problem is. Tell me what the problem is, because it is where it should not be. Thanks in advance!
alert('Hello World');
5a87383ec3238648862215.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
monochromer, 2018-02-22
@pmozil

scr="js/script.js"- correct the attribute name to src.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question