Is it wrong to display script tags in the middle of the page?

Just for convenience, I hope, using a server-side language, simply output a simple tag <script>using the jquery function document.ready(). Is this considered bad practice? I know that some people consider embedded javascript a bad practice, which makes me think about it.

+3
source share
4 answers

This is not a problem from a technical point of view, because it document.ready()only works after a complete analysis of the DOM.

I would not consider this a good style. This can make maintenance difficult because you can no longer see what happens with the loading of the document.

document.ready(), , head script , .

+10

, , . - , , . , - , .

+4

javascript <head></head>. , Yahoo , , . . : . , SEO, Google , , .

, script , , .

+2

-.

HTML , CSS .

, script, . script. script , document.ready( , script , HTML).

:
: ?

, , , . , script.

0

Source: https://habr.com/ru/post/1773278/


All Articles