Title: Defer and jQuery( document ).on( &#8216;ready&#8217;, function() {&#8230;
Last modified: July 15, 2018

---

# Defer and jQuery( document ).on( ‘ready’, function() {…

 *  [drazon](https://wordpress.org/support/users/drazon/)
 * (@drazon)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/defer-and-jquery-document-on-ready-function/)
 * I have been using this plugin for a few weeks and I noticed that there are a 
   couple of issues when jquery is defered and there are blocks of code (NOT inline
   but on external scripts which depend on jQuery.js) like
 * `jQuery( document ).on( 'ready', function() {...`
 * Those are not executed and don’t even throw a javascript error in the console!–
   I was surprised by the last one.
 * However something like this below works perfectly fine
 *     ```
       document.addEventListener('DOMContentLoaded', function() {
       	...
       }, false);
       ```
   
 * Is there any way to handle this behavior without making render blocking the jquery.
   js?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/defer-and-jquery-document-on-ready-function/#post-10527339)
 * I honestly have no idea I’m afraid Drazon, sorry … Maybe jQuery wizards could
   help you out here, on StackOverflow.com or something along those lines?

Viewing 1 replies (of 1 total)

The topic ‘Defer and jQuery( document ).on( ‘ready’, function() {…’ is closed to
new replies.

 * ![](https://ps.w.org/async-javascript/assets/icon-128x128.png?rev=1839260)
 * [Async JavaScript](https://wordpress.org/plugins/async-javascript/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/async-javascript/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/async-javascript/)
 * [Active Topics](https://wordpress.org/support/plugin/async-javascript/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/async-javascript/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/async-javascript/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/defer-and-jquery-document-on-ready-function/#post-10527339)
 * Status: not resolved