I have separated the various page components in another php file. In the navigation php file, I have objects that I want to use in javascript. where should i put javascript <script ...>so that it loads normally? right now i put it in a completely separate header.php file? but i don't think javascript selects objects from nav.php i hope i make sense;)
<script ...>
The standard suggestion is that you should put all your SCRIPT links before your closing BODY tag at the bottom of the document. This simplifies network connections:
http://developer.yahoo.com/performance/rules.html
, PHP , , HTML javascript HTML , javascript.
javascript javascript , , jquery document.ready.
, <script> HTML-.
<script>
, script ?
, , , . HTTP/1.1 , . , , . script .
. , , script document.write , . . .
, , . DEFER , script document.write , . , Firefox DEFER. Internet Explorer script , , . a script , . -.
, , ( ), , .
.
Source: https://habr.com/ru/post/1730481/More articles:Several lines have several submit buttons, do I need to make a form for each button? - htmlAre input limits directory or disk? - filesystemsBookmarks for sites after Ajax for the gate - ajaxhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1730479/sql-server-parallels-to-oracle-alter-table-set-column-unused&usg=ALkJrhg3DQcUTqq160qKd2U9XXszm6TUQQDesigning a Visual Studio 2010 Integration Package - visual-studio-2010URLs for Ajax request results - javascriptCheck if this DB object is used in Oracle? - functionLINQ to EF left join with multiple conditions - left-joinCan I use column properties in expressions in Powerbuilder? - syntaxsynchronizedCollection and contains - do I need to synchronize manually? - javaAll Articles