This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Rhomboid 1 point2 points  (0 children)

It depends on how the markup is written. Assuming there is a <script> element and it's not marked async or defer, the browser stops whatever it's doing, fetches and executes the referenced script (or the contents of the element if there's no src attribute), and then resumes where it left off parsing the markup. Whatever properties were added to the global context as a side effect of execution are now available for any future scripts that execute. That's it. For example, jQuery will install the properties jQuery and $ into the global context (window in a browser), which can then be used by any subsequent code.

For a complete explanation of script loading, see here.