Title: Bug with &#8220;Load JavaScript deferred&#8221; WP Rocket
Last modified: June 26, 2019

---

# Bug with “Load JavaScript deferred” WP Rocket

 *  [Sébastien Rodriguez](https://wordpress.org/support/users/sebtiz13/)
 * (@sebtiz13)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/bug-with-load-javascript-deferred-wp-rocket/)
 * Hello, if i active the option “Load JavaScript deferred” on WP Rocket the JS 
   script of cookie notice does’t work.
 * I have this error on console:
    `t.fn.getCookieNotice is not a function`
 * I checked the code and it appears this error is caused by the fact that WP Rocket
   adds a defer to the JS with this option and in JS file `$(document).ready` its
   call before assignments.
 * The quick fix may be to move the assignments before `$(document).ready`, its 
   work for me

The topic ‘Bug with “Load JavaScript deferred” WP Rocket’ is closed to new replies.

 * ![](https://ps.w.org/cookie-notice/assets/icon-256x256.png?rev=3549327)
 * [Compliance by Hu-manity.co](https://wordpress.org/plugins/cookie-notice/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cookie-notice/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cookie-notice/)
 * [Active Topics](https://wordpress.org/support/plugin/cookie-notice/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cookie-notice/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cookie-notice/reviews/)

## Tags

 * [defer js](https://wordpress.org/support/topic-tag/defer-js/)
 * [optimization](https://wordpress.org/support/topic-tag/optimization/)
 * [wprocket](https://wordpress.org/support/topic-tag/wprocket/)

 * 0 replies
 * 1 participant
 * Last reply from: [Sébastien Rodriguez](https://wordpress.org/support/users/sebtiz13/)
 * Last activity: [6 years, 11 months ago](https://wordpress.org/support/topic/bug-with-load-javascript-deferred-wp-rocket/)
 * Status: not resolved