JQuery conflict for noob

bangertbangert Member
in Help edited September 2014
So I read on the forums a way to fix a jquery conflict is to change the version of jquery that FC uses but i cant figure out how to do that.

I already looked at this page https://wiki.foxycart.com/v/2.0/getting_started/site_setup and I don't see what I should be seeing.
I did a bunch of searching but i cant seem to figure this out. If someone can walk me though it id highly appreciate it. I currently have this loaded to my site and a button.
<script src="//cdn.foxycart.com/bangert/loader.js" async defer></script>

My site currently uses
jquery-2.1.0.min.js
Comments
  • fc_adamfc_adam FoxyCart Team
    @bangert,

    Could you let us know a page we can view with the conflict happening please? Feel free to whisper if you want to keep it private.
  • fc_adamfc_adam FoxyCart Team
    @bangert,

    Try moving the loader.js FoxyCart include to be below your jQuery include at the bottom of your page. Our script will look for jQuery already on the page to decide if it should include jQuery itself or not, but as the script is included before jQuery, it doesn't exist at that point. You're seeing it work sometimes though as jQuery is cached and so does exist before loader.js executes.
  • brettbrett FoxyCart Team
    @bangert, I'm seeing a javascript error on your page:
    Uncaught TypeError: Cannot read property 'nodeType' of undefined jquery-2.1.0.min.js:2
    
    That's not very descriptive, but you've got the following weird comment inside a <script> tag:
    <!-- FC footer script insertion -->{% include template_from_string(fc_footer_content) %}<!-- /FC footer scripts -->
    
    That's … I'm not sure? But that's an HTML comment inside a script tag, which I don't think is what you want. Try removing that bit and see if it resolves the problem. Let us know what you find out :)
  • fc_adamfc_adam FoxyCart Team
    @bangert {in response to whisper}

    Could you please try running jQuery version 1.11.1 instead of 2.1.0 - and place the FoxyCart include below the jQuery include again - and see if that corrects anything?
  • fc_adamfc_adam FoxyCart Team
    @bangert {in response to whisper}

    I just did some deeper testing on your page, and it appears that this relates to specifically the countDown() jQuery function at the bottom of your page. If you remove that, the FoxyCart javascript functions just fine, and the "nodeType" error Brett mentioned earlier disappears.
Sign In or Register to comment.