Are External Scripts In The Head Of An Html Document Guaranteed To Execute Before Scripts Contained Within The Body?
I'm trying to execute some inline javascript within an HTML page as early in page processing as possible that makes use of library functions in an external .js file. While I've a
Solution 1:
JavaScript statements that appear between <script>
and </script>
tags are executed in order of appearance. So yes, it is guaranteed, unless you are doing something clever like deferred loading or something similar.
Post a Comment for "Are External Scripts In The Head Of An Html Document Guaranteed To Execute Before Scripts Contained Within The Body?"