Title: Javascript Syntax Error
Last modified: August 31, 2016

---

# Javascript Syntax Error

 *  Resolved [tom96](https://wordpress.org/support/users/tom96/)
 * (@tom96)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/javascript-syntax-error/)
 * Hello,
    after updating WordPress, autooptimize.js started to throw errors and
   some functionality on my page broke.
 *     ```
       autoptimize_aa384a8….js:3 Uncaught Error: Syntax error, unrecognized expression: a[href*=#]:not([href=#])
       in /wp-content/cache/autoptimize/js/autoptimize_aa384a83187419084cc83c4d06167a05.js
       ```
   
 * I’m using WordPress 4.5.2 and Autoptimize 2.0.2 and I think the issue is related
   to this:
    [http://support.yithemes.com/hc/en-us/articles/218754127-WordPress-4-5-Uncaught-Error-Syntax-error-unrecognized-expression-a-href-not-href-](http://support.yithemes.com/hc/en-us/articles/218754127-WordPress-4-5-Uncaught-Error-Syntax-error-unrecognized-expression-a-href-not-href-)
 * for reference, this is the page that broke:
    [http://marco-koch.org/](http://marco-koch.org/)
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/javascript-syntax-error/#post-7388835)
 * The problem is actually in your theme, more specifically wp-content/themes/Divi_2-
   5/js/custom.js tom96, which has this line of code;
 *     ```
       $( 'a[href*=#]:not([href=#])' ).click( function() {
       ```
   
 * which does not work with the version of jquery shipped with wordpress 4.5.x (
   cfr. [confirmation of that fact here](https://wordpress.org/support/topic/read-this-first-wordpress-45-master-list?replies=7#post-8268201))
 * upgrading to the most recent version of Divi should fix this nasty issue;
 * > Divi Version 2.7.3 ( updated 04-13-2016 ) fixes the jQuery issue outlined below.
   > Update your theme.
 * hope this helps,
    frank

Viewing 1 replies (of 1 total)

The topic ‘Javascript Syntax Error’ 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

 * [autooptimize](https://wordpress.org/support/topic-tag/autooptimize/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [js](https://wordpress.org/support/topic-tag/js/)
 * [WordPress 4.5.2](https://wordpress.org/support/topic-tag/wordpress-4-5-2/)

 * 1 reply
 * 2 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [9 years, 12 months ago](https://wordpress.org/support/topic/javascript-syntax-error/#post-7388835)
 * Status: resolved