Hm, this does make sense when thinking about it. Of course injecting a bunch of javascript into html instead of making it proper javascript files and linking to them is the wrong way to go about things - but for small project it really is easy
Thanks a lot for your help!