1

I'm trying to resolve some Javascript errors on a site I'm working on (built using the Gantry framework), as I have a sneaking suspicion they're keeping some plugins from working properly. For instance, the menu does not properly expand on small screens when the "menu" button is clicked, and support docs for the plugin suggest that's caused by Javascript errors. Moreover, I'd just like to clean things up so that I'm avoiding errors in general.

Examining the console log, I see the following messages:

Uncaught ReferenceError: Class is not defined rokmediaqueries.js:80

Uncaught TypeError: Object [object global] has no method 'addEvent' www.associatedkyotoprogram.dreamhosters.com/:95

I'm nearly certain the ReferenceError has something to do with Gantry, because the "rok" prefix is used by RocketTheme, the team behind Gantry. I'm less sure about the TypeError.

Either way, I don't have the knowledge to resolve these issues. Could anyone please point me in the right direction (or explain to me how to fix them)?

Thank you so very much.

1
  • 1
    These are javascript errors related to a commercial theme.
    – Wyck
    Commented Aug 28, 2013 at 21:10

1 Answer 1

1

Fixed.

Thanks to some feedback on reddit (see this thread and this one), I learned that the issue was that the mootools.js script was being loaded far too late.

I solved it (rather inelegantly, I'm sure) by adding this line to themes/rt_gantry_wp/index.php, around line 30 or so (before the if blocks):

$gantry->addScript('/wp-content/plugins/gantry/js/mootools.js');  

It's no longer throwing either of those errors. The menu still doesn't work, but that's, apparently, a different problem.

The code's a rat's nest, but this solved the issue, and will hopefully point anyone who has this problem in the future toward a more elegant solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.