myFuncti...">

How do browsers handle multiple javascript tags?

Does the browser support these two fragments equally ?:

    <script type="javascript">
     myFunction1();
     myFunction2();
    </script>

Vs.

<script type="javascript">
 myFunction1();
</script>
<script type="javascript">
 myFunction2();
</script>
+3
source share
1 answer

They will be absolutely equivalent. There are no differences in difference, no differences in performance, nothing.

The only difference is that in the analyzed DOM there will be two instead of one element script.

+3
source

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


All Articles