Javascript in the middle of the code?

Asked

Viewed 25 times

0

I would like to know in what practical situations a JS script would be written in the middle of HTML code and not declared in a separate file on head or at the end of body.

Thanks in advance.

  • Sometimes I use only for practicality, to facilitate maintenance. Whether it is good or bad, I never sought to know. In other cases when it involves back-end, where I want to run a script in a certain position depending on a back-end variable, which I couldn’t do in one. js the part.

1 answer

0

I know for example the EJS, is a Javascript engine and serves for when you want to bring data from the back end to the front end, and display in a field, label, among others. This you can do in the middle of HTML.

Browser other questions tagged

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