If you do not want to use jQuery you can use _spBodyOnLoadFunctionNames, but be careful if you use this method you should keep in mind that you need to use ClientId to be sure that your function is unique on the page, because this method does not check how many times do you push your function and can call it several times.

Also will be nice to use ClientId to specify id of your divID, in this case you can use several web parts on the page and don't worry that they will be work incorrect with your js function.

Both of the above answers are true, but incomplete because there are times where your code could be loaded twice, so what you really want to do is implement SharePoint lazy loading of scripts with Scripts On Demand. Lazy loading of scripts also significantly improves page performance.