I’m unable to call an external . js to an html page

Asked

Viewed 48 times

0

I started very recently to learn about js, and I’m having trouble calling one. js external to my html page, I searched in several places but found nothing other than the error that the browser claims to have a 'Uncaught Syntaxerror: Missing ) after argument list' and I don’t know what to do. I’m sorry if the question comes out a little unnatural or strange, it’s my first time here. The contents of the archive aula01.js is just below.

<html lang="pt-br">
    <head>
        <meta charset="utf-8"/>
        <title>Aula 01-JS</title>
    </head>
    <body>
        <script type="text/javascript" src="aula01.js" ></script>
    </body>
</html>

Conteúdo do arquivo .js
alert('Esse é o meu primeiro código JS';
  • Is aula01.js in the same folder as your HTML? What is the content of this aula01.js file?

  • Yes files are in the same folder, and the aula01.js file has an Alert command

  • Edit the question and place its contents (js), please.

  • All right, I edited.

  • Good afternoon, check the function syntax and you will see that the error warning itself is giving the solution...

  • Thank you to vcs tmb and good afternoon

Show 1 more comment

1 answer

4


Look at your mistake

Uncaught Syntaxerror: Missing )

inserir a descrição da imagem aqui

Lacked a ) after ...JS';, should be at the end of the script JS' ) ; the relatives

It should stay as below

alert('Esse é o meu primeiro código JS');

  • Wow I didn’t even notice, thank you very much

  • @If Chadii resolves remember to mark the answer as accepted by clicking the below of the arrows next to the answer, so it is not open even with the problem already solved. Good luck studying and attention to detail ;)

  • 1

    Solved yes, thank you very much. I will pay attention more thank you :D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.