It's not ideal, because now it'll load and execute the JavaScript before rendering the page.

But... If that was an issue beforehand then it was one that definitely shouldn't be fixed by placing the JavaScript at the bottom of the page because if it needed to work on the DOM then it should wait until the DOM has loaded and attached to the appropriate event.