$.getScript is asynchronous. You're starting the process of grabbing the script in the order you see, but those requests may complete in any order at all (depending on the size of the resource, thread scheduling on the server, network vagaries, etc.). Whichever ones complete first will get run first, potentially not in the requested order.
In a comment you've asked:
However, I would like to execute the JS scripts in the order they are requested. How could i do that?
If I assume you want to make minimal changes (not switching to modules or something), then you could use a promise chain, either with native promises (or a polyfill for native promises) or jQuery's Deferred object.
With native promises: Make each call to $.getScript look like this:
var getScriptPromise = getScriptPromise || Promise.resolve();
getScriptPromise = getScriptPromise.then(function() {
return $.getScript("{% static 'network-virtualRouter.js' %}");
});
With $.Deferred: Make each call to $.getScript look like this:
var getScriptPromise = getScriptPromise || $.Deferred().resolve().promise();
getScriptPromise = getScriptPromise.then(function() {
return $.getScript("{% static 'network-virtualRouter.js' %}");
});
In both cases, we're using the semantics of var at global scope to either create the variable (if it's the first of these in the document) or use the existing variable (if not). If we created it, we create a fulfilled promise. If we didn't create it, we use the promise it already refers to. Then we use then to chain from it and make the next call to $.getScript. $.getScript returns a thenable, so returning it from then resolves the promise then returns to the thenable from $.getScript, meaning it waits for that thenable to settle and settles the same way.
End result: Each $.getScript call doesn't start until the previous one finishes.
If you want to have all the requests start at the same time, but then run the returned scripts in order, you'll have to use $.ajax instead to retrieve the script text, then perhaps $.globalEval to run it when you know it's that script's turn.