JavaScript don't have to be preexecuted because it is a client side language rather than server side language. The code runs as soon as the browser loads the code. Unless you specifically coded it so it runs after the entire page finishes loading. Reason we recommend JavaScript over preexecution is to off load server side load to client side, hence making the MS server able to support more concurrent users/publishing. If you are using AJAX to load information from another page, the best practice is to have a loading message prior to display of content.