executeJavaScript and window initialization order problem

I think i have the logic, but how do i include a .js file into a specific window?
The code is executable through a functioncall, so executeJavascript can trigger the function.