I'm using Drupal 7 mothership theme and installed views accordion and nivo slider. On the views page where I can preview the content that will be published to the block and the page, I see the accordion works there, however on the actual page, I get Uncaught TypeError: Object [object Object] has no method 'accordion' and on the home page that has the nivo slider I get Uncaught TypeError: Object # has no method 'nivoSlider'. My guess is I have two versions of jQuery running at the same time or the files may not be in the right order.
I'm not sure but from what I see in the core directory, jQuery 1.4.4 is for the core files and I jave jQuery 1.8.3(which is the script.js?mg3zbe file, second to last) and if I take 1.4.4 out of the site I get a bunch of jQuery is undefined for core and if I take jQuery 1.8.3 out of the theme, I get undefined for my greyscale-fade plugin and then that breaks.
I'm not sure what to do and how I can reorder the jQuery files in Drupal. In my .info file, I just have to js files
;-------------- JS -------------
scripts[] = js/script.js
scripts[] = js/greyscale-fade.js
http://i.stack.imgur.com/CBRSH.png
I'm hoping someone can point out what's wrong and a solution for this. It's driving me crazy.
Here is also a screen shot to show I do have the accordion setup correct so I can rule that out.
http://i.stack.imgur.com/Zl4Ko.png
Comments
You should never have two
You should never have two versions of jquery running on your site, it will cause conflict. 1.4.4 is part of core, so you should not remove that. You will need to remove the other one, and fix the errors that you end up with.
Jaypan We build websites
Object [object Object] has no method 'accordion'
How did this go? I have the same error message with Drupal 7 and Views Accordion - I think this is why my accordion isn't appearing as such.
Would appreciate any knowledge that would help me debug this.
I did have a second version of jQuery loaded, but got rid of it and restarted a while ago. I can't see why this error is cropping up
Henry
UPDATE: threw together a basic site with the Bartik theme and Views Accordion worked ok. The site I want it to work on is a custom theme based on Zen that I built. I don't know is the theme's the problem, or it could be a module I have running on that site...
UNSURPRISING FURTHER UPDATE: Yep my theme was - somehow - loading another jQuery version even though I'd commented it out in the .info file. Now works fine :)
Good to hear :)
Glad to hear you got it working ok :)
"You'll need to pretend it's
"You'll need to pretend it's still November 2010 so you can spend an eternity rewriting your custom scripts to end up with a site that has far lower performance."
I don't think so.
What?
What?
Jaypan We build websites
Wat?
Wat?