Asset is asynchronous. This means that when you call myfunc(foo) outside the call to Asset.javascript, there is no guarantee that file1.js has loaded yet.
When you call myfunc() inside the onload() function, that is where it's guaranteed that file1.js has been loaded.
