I am working with both amq.js (ActiveMQ) and Google Maps. I load my scripts in this order
Is there a way to make sure both scripts load before I use them?
Yes.
Put the code you want loaded last (your application.js
stuff) into prototype's document.observe. This should ensure that the code will load only after prototype + other stuff is finished and ready. (If you are familiar with jQuery, this function is similar to jQuery's $(document).ready
)
You can also use the built in SharePoint javascript method to control the execution of your scripts;
_spBodyOnLoadFunctionNames.push("yourFunction");