The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

jQuery error. jQuery loaded twice

ChuckTrukkChuckTrukk Member
in Bugs & Feature Requests edited December 2010
I've had this problem on a number of sites.

I load jquery on the page, then foxycart loads jquery again.

I recommend foxycart loading jquery the following module way:
http://alexmarandon.com/articles/web_widget_jquery/#loading-javascript-libraries

This is how we've created 'foxy widget's in the past and it worked really well.
Comments
  • lukeluke FoxyCart Team
    Hey Chuck, thanks for posting that. I've been talking to Brett about this for a while because what you're describing is probably the #1 support issue we deal with. We've also been looking into using http://headjs.com/ as well. Any thoughts on headjs?
  • webmovementllcwebmovementllc Member, Integration Developer, FoxyPress
    Hey Chuck,
    I've had this problem with a plugin I created. I thought I had it fixed, but it is proving to be a problem. I'm going to try out the link you sent. Thanks for the info.
    Adam
  • Luke,

    Chuck and I were discussing this earlier while debugging a site using LABjs (Loading and Blocking Javascript) but once we built a custom foxycart.js file that excludes jQuery all was well. I'd think there should be a jquery free version as an option since it is so ubiquitous and when using global templates for a site it removes the chance of conflicts.

    BTW: I ruled out head.js and control.js for a number of reasons but mostly as a result of testing and reading this.

    Cheers,

    Jay
  • Hey luke,

    Whichever implementation you choose is fine w/ me. The above 'module'-like approach seems the simplest. If the required jquery version is present, it uses it. Else it loads the jquery version it needs and keeps it in it's own scope so nothing else is touched.
  • brettbrett FoxyCart Team
    @smashingred, can you clarify building a foxycart.js file that excludes jQuery? As of v0.7.0 foxycart.js and even foxycart.complete.js don't have jQuery in it anymore, so I want to make sure I understand what you did so we can plan out appropriate steps.
Sign In or Register to comment.