Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Colorbox has ceased working for me on Chrome 27.0.1453.93 (OSX 10.8.3)
When clicking on an image the colorbox appears with the loading graphic and just hangs.
I get an "Uncaught Error: NotFoundError: DOM Exception 8 " error in the dev tools console.
Call stack (using uncompressed colorbox):
Uncaught Error: NotFoundError: DOM Exception 8 jquery.js:125
c.extend.clean jquery.js:125
c.buildFragment jquery.js:121
c.fn.extend.domManip jquery.js:120
c.fn.extend.append jquery.js:114
publicMethod.prep jquery.colorbox.js:570
(anonymous function) jquery.colorbox.js:810
Comments
Comment #1
jacklmoore CreditAttribution: jacklmoore commentedHi, Colorbox's author here. I had another user report this problem and a potential fix. However, I haven't been able to reproduce the issue (using OSX 10.8.3 and jQuery 1.9.0). He replaced the following line in jquery.colorbox.js:
$(photo = new Image())
With essentially this:
I don't suppose you could try this and tell me if it resolves your problem as well? If that does fix the issue, could you also try the following:
At this point I don't understand what could be wrong with the original code. And my apologies, I wouldn't ask for this if I could reproduce it myself.
Comment #2
tripper54 CreditAttribution: tripper54 commentedHi Jack. Thanks for the quick response. I tried both of the fixes above. The first one worked, but the second one did not.
Hope this helps.
Comment #3
tripper54 CreditAttribution: tripper54 commentedNot sure if this helps - I just fired up a winXP virtual machine that had chrome 26 installed on it. Colorbox worked fine.
I then updated chrome to the latest version - 27.0.1453.94 m . Now colorbox is broken, with the same error.
Comment #4
jacklmoore CreditAttribution: jacklmoore commentedThanks, I'm happy to get confirmation that it resolved the issue. I committed an update to Colorbox earlier with a similar change as to what worked for you. Instead of using
photo = $('<img>').get(0);
, it usedphoto = document.createElement('img');
I couldn't verify that it resolved the issue, but it *should* since jQuery also uses document.createElement. I've never run into an issue with creating DOM img objects with
new Image()
before, so it may just be a temporary Chrome bug.Comment #5
tripper54 CreditAttribution: tripper54 commentedThe latest version solves the issue, thanks again.