I mean, if the first declared functions are the first loaded functions?
Because, if so, I can add var loaded = trueto the end of the file to find out if it is loaded (I know that I can use it onload, but I also need this alternative).
var loaded = true
onload
Much depends on the browser you use. Depending on your requirements, you can use the script loader . Thus, you can declaratively determine which scripts you want to download, and the loader will ensure that they are loaded once. Also here is a bit more info on javascript loading.
HTML , SCRIPT , . javascript, .
Its really worth using a framework like jquery or YUI when creating something serious with javascript, but to answer your question: yes, my understanding is that javascript files are executed as they are downloaded.