wrap all of the javascript in $(document).ready. No need asking for data that we are not ready to handle