开发者

How do browsers process multiple javascript tags?

开发者 https://www.devze.com 2023-01-12 20:20 出处:网络
Does a browser process these two snippets the same way?: <scrip开发者_开发问答t type=\"javascript\">

Does a browser process these two snippets the same way?:

    <scrip开发者_开发问答t type="javascript">
     myFunction1();
     myFunction2();
    </script>

Vs.

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


They will be absolutely equivalent. There are no scope differences, no execution differences, nothing.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消