Question: How do I prevent JavaScript from blocking other JavaScript's from starting to download?

I have the following on my web site:

```
<html>
<body>
....
<script type="text/javascript" src="http://example.com/ex.js"></script>
<script type="text/javascript" src="http://google.com/google-maps.js"></script>
</body>
</html>

```

When I use the YSlow Firefox add-on, I can see from the network traffic tab that the `google.com/google-maps.js` JavaScript won't start downloading until `ex.js` has finishes downloading.

**Question**: How can I have both `ex.js` and `google-maps.js` begin downloading immediately and in parallel?

Answer: 
This is normal for inline scripts in HTML. You could add the scripts dynamically using the following code:

```
<script type="text/javascript">
    var head  = document.getElementsByTagName("head")[0]; 
    var sTag1 = document.createElement("script");
    var sTag2 = document.createElement("script");
    sTag1.type = sTag2.type = "text/javascript";
    sTag1.src = "http://example.com/ex.js";
    sTag2.src = "http://google.com/google-maps.js";
    head.appendChild(sTag1);
    head.appendChild(sTag2);
</script>

```

This could cause unexpected results, however - they may not be downloaded and parsed in the correct order, which is important if script 2 references variables or functions from script 1. 

If you just want your HTML to load before the scripts load, keep them sequential and put them **at the bottom** of your HTML file, not in the head tag. This will load the page before downloading and parsing the script. See <http://developer.yahoo.net/blog/archives/2007/07/high_performanc_5.html>.
The JavaScript files will always download in the order they are specified.