34,333
edits
Changes
→Where to place JavaScript in a Web Page
== Where to place JavaScript in a Web Page ==
In this section we have looked and both inline and external JavaScript (using the ''src'' argument of the ''<script>'' element). The question now arises as to which is the best approach. The general recommendation is that JavaScript functions should be placed in external ''src'' files wherever possible. The reasoning behind this is that if you have JavaScript code that is used on multiple plages pages you can modify this code in one place (the external JavaScript file) without having to edit every page that contains the code.
<hr>