• I’m merging Foundation 4 with Bones to create a WP Starter theme. I had everything working fine with the JS from Foundation 3, but now that I’m trying to implement the Foundation 4 JS I’m running into some issues.

    I followed the steps found in the Foundation 4 JS Documentation, but still had no luck. Here is the code I placed directly before the closing body tag (I know the correct way is to enqueue the script, but for testing I was just pasting it directly above the closing body tag):

    <script>
      document.write('<script src=http://theadgarage.com/jointswp/wp-content/themes/bones-master/library/js/vendor/'
        + ('__proto__' in {} ? 'zepto' : 'jquery')
        + '.js><\/script>');
        </script> 
    
        <script src="http://theadgarage.com/jointswp//wp-content/themes/bones-master/library/js/foundation.min.js"></script>
    
        <script>
      $(document).foundation();
      </script>

    I’m attempting to open a modal on this page, but as you can see, the modal never fires when you click the link. I notice some errors in the Javascript console, but I’m still new to JS so they are a bit over my head.

    As I mentioned before, things were working fine with the Foundation 3 JS, which didn’t require the call to initialize the function – it just seemed to work. Not sure if that makes a huge difference, but it’s something I noticed that was different about the documentation for Foundation 4 JS compared to Foundation 3 JS.

    Can anyone get me pointed in the right direction?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Javascript Errors, $ is not a function’ is closed to new replies.