Title: Javascript issue with drop down toggle text
Last modified: February 2, 2021

---

# Javascript issue with drop down toggle text

 *  Resolved [mattaus03](https://wordpress.org/support/users/mattaus03/)
 * (@mattaus03)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/javascript-issue-with-drop-down-toggle-text/)
 * Hi,
 * Activating Autoptimize has really helped my website speed; however I have a FAQ
   section on my site that uses drop down toggle text (i.e. click on a FAQ and then
   the text appears underneath, click it again and it disappears – pretty standard).
 * It seems to be an issue with the Javascript Options; as I can keep the Autoptimize
   CSS Options and HTML Options activated, but as soon as I try to activate the 
   Javascript Option I run into trouble.
 * I’ve tried selecting ‘Force JavaScript in <head>?’ and ‘Add try-catch wrapping?’
   just to see if that did anything; but it didn’t -> as soon as I select ‘Aggregate
   JS-files?’ I get the error.
 * I have gone hunting around all over the place trying to find the specific javascript
   causing the problem so that I could add it to ‘Exclude scripts from Autoptimize:’;
   but my trial and error approach has not worked. My default exclude scripts list
   includes the following: wp-includes/js/dist/, wp-includes/js/tinymce/, js/jquery/
   jquery.js, js/jquery/jquery.min.js
 * If I try debugging the error from console, I get the following:
 * Uncaught ReferenceError: jQuery is not defined (autoptimize_1cfcbc72a2417d8f150b7780e93f71b2.
   js:5)
    at Function.u.extend (autoptimize_1cfcbc72a2417d8f150b7780e93f71b2.js:
   5) at Object.c.widgetsTypes (autoptimize_1cfcbc72a2417d8f150b7780e93f71b2.js:
   5) at __webpack_require__ (autoptimize_1cfcbc72a2417d8f150b7780e93f71b2.js:5)
   at Object.c.widgetsTypes (autoptimize_1cfcbc72a2417d8f150b7780e93f71b2.js:5) 
   at __webpack_require__ (autoptimize_1cfcbc72a2417d8f150b7780e93f71b2.js:5) at
   Object.<anonymous> (autoptimize_1cfcbc72a2417d8f150b7780e93f71b2.js:5) at __webpack_require__(
   autoptimize_1cfcbc72a2417d8f150b7780e93f71b2.js:5) at autoptimize_1cfcbc72a2417d8f150b7780e93f71b2.
   js:5 at autoptimize_1cfcbc72a2417d8f150b7780e93f71b2.js:5
 * Any clues as to what is going on here? Any help much appreciated.
 * Matt

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/javascript-issue-with-drop-down-toggle-text/#post-13989853)
 * can you share your site’s URL so I can have a look Matt?
 *  Thread Starter [mattaus03](https://wordpress.org/support/users/mattaus03/)
 * (@mattaus03)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/javascript-issue-with-drop-down-toggle-text/#post-13989955)
 * Sure:
    [https://mattboyle.com.au/faq/](https://mattboyle.com.au/faq/) Just switched
   the ‘Aggregate JS-files’ back on. Definitely getting the problem in the Brave
   browser. Firefox seems to be sporadic. But if you try it with Brave you’ll definitely
   see what I’m talking about.
 * Thanks so much.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/javascript-issue-with-drop-down-toggle-text/#post-13990047)
 * Looks like you’re also using something to Async Javascript, you’ll have to make
   sure jquery.min.js is not asynced Matt.
 *  Thread Starter [mattaus03](https://wordpress.org/support/users/mattaus03/)
 * (@mattaus03)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/javascript-issue-with-drop-down-toggle-text/#post-13990487)
 * Absolutely amazing…spot on!!
    Worked like a charm. Thankyou so much. So so appreciated.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/javascript-issue-with-drop-down-toggle-text/#post-13990502)
 * you’re welcome, feel free to [leave a review of the plugin and support here](https://wordpress.org/support/plugin/autoptimize/reviews/#new-post)!
   🙂
 * frank

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

The topic ‘Javascript issue with drop down toggle text’ 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/)

## Tags

 * [drop-down](https://wordpress.org/support/topic-tag/drop-down/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [js](https://wordpress.org/support/topic-tag/js/)
 * [toggle](https://wordpress.org/support/topic-tag/toggle/)

 * 5 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/javascript-issue-with-drop-down-toggle-text/#post-13990502)
 * Status: resolved