+ 2
where should i put js code? can it be a part of html doc, using tag <script>? or should it be written as stand-alone file and get linked to html using <link> in head? can u give an example plz?
4 Réponses
+ 7
You also use <script> to link to a separate js file, not <link>.
You can do one or the other. Using a separate file is usually a good idea. It can even be cached by the browser, which is useful if you use the same js file in different html pages.
<script>
//your javascript code here
</script>
<script src="path/to/your/external_script.js"></script>
+ 2
the world enginers computer advice to put js code before body closing tag like the <script></script></body> cuz it will let ur page load
+ 2
помогите
0
v