Title: Checking JavaScript Options breaks menu dropdown
Last modified: December 8, 2017

---

# Checking JavaScript Options breaks menu dropdown

 *  Resolved [Annemarie](https://wordpress.org/support/users/tat2d/)
 * (@tat2d)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/)
 * Hello, I’m trying to speed up a client’s site, so I installed Autoptimize. When
   I enable the options, it breaks the slider. We have some exceptions listed in
   the JavaScript field so the slider works, but it breaks the dropdown menus. Here
   are the errors we get with the JS option enabled (Ignore the Google one):
 * (index):9 Uncaught TypeError: Object.merge is not a function
    at (index):9 (anonymous)
   @ (index):9 (index):13 Uncaught TypeError: window.addEvent is not a function 
   at (index):13 (anonymous) @ (index):13 (index):15 Uncaught TypeError: window.
   addEvent is not a function at (index):15 (anonymous) @ (index):15 (index):7 GET
   [https://www.googletagmanager.com/gtm.js?id=GTM-MMBGLQD](https://www.googletagmanager.com/gtm.js?id=GTM-MMBGLQD)
   net::ERR_ABORTED (anonymous) @ (index):7 (anonymous) @ (index):8 autoptimize_ca20b3f4c416a5b1cf389d5809ddafbd.
   js:689 Uncaught SyntaxError: Invalid regular expression flags
 * I’m not sure how to fix the dropdowns or speed up the site without the JS options
   enabled. Can you help?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fchecking-javascript-options-breaks-menu-dropdown%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9764769)
 * Evening [@tat2d](https://wordpress.org/support/users/tat2d/);
    Can you try adding`
   plugins/wp_roksprocket/assets/js/` to the comma-separated JS optimization exclusion
   list?
 * frank
 *  Thread Starter [Annemarie](https://wordpress.org/support/users/tat2d/)
 * (@tat2d)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9764956)
 * Thank you for your reply. I added that but it’s still not working.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9765057)
 * well, what JS errors do you see on the browser console now?
 *  Thread Starter [Annemarie](https://wordpress.org/support/users/tat2d/)
 * (@tat2d)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9765177)
 * Sorry about that,
 * [http://www.googletagmanager.com/gtm.js?id=GTM-MMBGLQD](http://www.googletagmanager.com/gtm.js?id=GTM-MMBGLQD)
   Failed to load resource: the server responded with a status of 404 ()
    autoptimize_672fa78b7d1e28708f761e7cd260a827.
   js:684 Uncaught SyntaxError: Invalid regular expression flags biblestudymedia.
   com/:14 Uncaught TypeError: RokSprocket.Slideshow is not a constructor at biblestudymedia.
   com/:14 at mootools.js:376 at Array.forEach (<anonymous>) at Function.forEach(
   mootools.js:33) at Array.each (mootools.js:40) at fireEvent (mootools.js:375)
   at HTMLDocument.r (mootools.js:515)
 * The Google error is there no matter what, so unless that’s part of the problem,
   you can ignore it.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9765703)
 * the `Invalid regular expression flags` is somewhat more difficult to identify
   so I’ll need to see that “live” somehow, but for the 2nd one you’ll also need
   to exclude `plugins/wp_roksprocket/layouts/features/themes/slideshow/slideshow.
   js`.
 *  Thread Starter [Annemarie](https://wordpress.org/support/users/tat2d/)
 * (@tat2d)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9768586)
 * I can send you login information to “break it” to see it. I just can’t leave 
   it broken since they receive a lot of traffic. Where can I send the information?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9768805)
 * I afraid I don’t log into other people’s site in the context of support here 
   @tad2d, esp. not on high-traffic sites. Do you have a non-prod system where you
   can leave things in a broken state?
 *  Thread Starter [Annemarie](https://wordpress.org/support/users/tat2d/)
 * (@tat2d)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9771573)
 * Let me create one. I’ll reply shortly
 *  Thread Starter [Annemarie](https://wordpress.org/support/users/tat2d/)
 * (@tat2d)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9771853)
 * Please see [http://bsm.sitedemo.work/](http://bsm.sitedemo.work/)
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9772994)
 * OK, for the “regular expression flags”-error you’ll need to exclude `plugins/
   gantry5/assets/js/main.js` from optimization, can you try that?
 *  Thread Starter [Annemarie](https://wordpress.org/support/users/tat2d/)
 * (@tat2d)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9775533)
 * That worked, thank you so much!
 *  Thread Starter [Annemarie](https://wordpress.org/support/users/tat2d/)
 * (@tat2d)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9775537)
 * For anyone else with the same issues, here’s what I’m excluding:
 * seal.js, js/jquery/jquery.js, revslider/public/assets/js, plugins/wp_roksprocket/
   assets/js, plugins/wp_roksprocket/layouts/features/themes/slideshow/slideshow.
   js, plugins/gantry5/assets/js/main.js

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Checking JavaScript Options breaks menu dropdown’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [Annemarie](https://wordpress.org/support/users/tat2d/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/checking-javascript-options-breaks-menu-dropdown/#post-9775537)
 * Status: resolved