WordPress.org

Ideas

Non-blocking Asynchronous wp_enqueue_script

  1. redwallhp
    Member

    12345

    It would be cool if WordPress could optionally use a non-blocking asynchronous loader for scripts loaded through wp_enqueue_script. (Example: http://www.webmaster-source.com/2010/06/07/loading-javascript-asynchronously/)

    Wp_enqueue_script already has an argument that lets you move scripts to the bottom, so why not an option for async?

    Posted: 5 years ago #
  2. Paris Holley
    Member

    I have just released a plugin that does that:

    http://wordpress.org/extend/plugins/asynchronous-javascript/

    Posted: 2 years ago #
  3. webaware
    Member

    12345

    For anyone who needs this, there's a dirty hack from @toscho on the WordPress Stackexchange:

    http://wordpress.stackexchange.com/a/38335/24260

    Posted: 2 years ago #
  4. Phil
    Member

    I am reading...

    Since Version 4.1 a new filter has been introduced that finally provides a less painful solution to add async or defer attributes...

    http://matthewhorne.me/add-defer-async-attributes-to-wordpress-scripts/

    ===================

    Installed the plugin, seems to be working - although PSI now reckons head.js is blocking ? correct ? should I expect this ?

    Remove render-blocking JavaScript:
    /aynnchronous-javascript/js/head.load.min.js

    Posted: 1 month ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    17 Votes
  • Status

    This idea is under consideration