Jquery breaks when I log out

Permalink
I'm building a site with a custom theme on localhost. I got thing working pretty well and then I decided to try logging out just to see the page without the concrete5 header. And all the jquery-dependent aspects broke. Jquery is frankly a bit over my head so I'm using pre-made jquery files from various places. I don't begin to know what the issue is. I am using version 5.7 and I have all cacheing off.

Here's a couple things that may or may not be relevant:

1. I am calling the external script file with something like this in the [head] tag:

<script src="<?php echo $view->getThemePath()?>/script/jquery.justifyNav.js"></script>


2. I'm calling the functions in the [head] tag as well with something like this:

<script>
   $(document).ready(function(){   
      $('ul#main_menu').justifyNav();
   });
</script>


I've read something about the [head] not being the best place, but I didn't really get it. Could this be the problem?

 
tukuro replied on at Permalink Reply
Nevermind. I feel silly now. I didn't load the main jquery library. I'm not totally sure why it worked while logged in. I guess concrete5 only loads the library when it's editing. I would delete the post but maybe someone else will learn from my mistake. Here's the loading code just for fun:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" ></script>