Closed (fixed)
Project:
Colorbox
Version:
7.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Feb 2011 at 08:20 UTC
Updated:
25 Apr 2011 at 12:11 UTC
My colorbox is throwing the following Javascript error whenever I click on a colorbox-enabled image on the home page:
$.data(this, colorbox) is undefined
The offending code (on line 208 of the uncompressed Javascript) is this:
var relRelated = $.data(this, colorbox).rel || this.rel;
Strangely, the colorbox code works fine on individual node pages.
Comments
Comment #1
frjo commentedDo you have en example site where we can see this problem
Can you replicate it on a clean install.
Comment #2
jennifermontes commentedMy site is live here: http://jennifermontes.com/
I'll try a clean install on my local machine and see what happens.
Comment #3
jennifermontes commentedOkay, I tried a clean install and Colorbox works fine... So that means there must be some kind of conflict with another module (*sigh*). I tried deactivating many of my modules and then clearing caches but no dice, so now I'm hunting around for where this could be coming from.
Starting from my original error in the Firebug console whenever I click on a Colorbox-enabled image: $.data(this, colorbox) is undefined. When I try the code without using the '$' shortcut, and specifying the 'colorbox' variable as 'jQuery.colorbox' I don't get an error anymore:
If I try to put the code that's throwing the error inside some code that re-associates '$' with jQuery, like this:
the console still complains, like so: ReferenceError: colorbox is not defined.
Honestly, I'm stumped. The lines previous to the one throwing the error use the '$' shortcut without any error and a few lines before that the 'colorbox' variable is being used without needing the 'jQuery.' prefix. What's happening? And why only on the front page?
Comment #4
frjo commentedA guess, but do you have some jQuery script that is not wrapped in:
Comment #5
jennifermontes commentedMaybe, but how could I find it?
Comment #6
frjo commentedDeselect "Bandwidth optimization" for JavaScript files in the performance settings.
Look up all the JS files that are loaded on the front page.
Firefox with the Firebug plugin or Safari with the developer tools activated etc. are a good help in this.
Comment #7
frjo commented