WordPress.org

Ready to get started?Download WordPress

Forums

Asynchronous Javascript
[resolved] Exclude certain JS files from plugin (8 posts)

  1. Paul Thomson
    Member
    Posted 1 year ago #

    Hello,

    Firstly congrats on providing such an excellent plugin.

    I was wondering whether it is possible to exclude certain Javascripts from loading within the plugin? This would be an excellent feature and one that I'm sure would appeal to many other people.

    If this can be done, can you please let me know how?

    If not, do you plan on implementing such a feature on future releases?

    Regards,

    Paul

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

  2. davemhui
    Member
    Posted 1 year ago #

    You can edit the head.js file of your blog because that is the javascript file that loads javascripts asychronously.
    But, make a backup of website before attempting this.

  3. Paris Holley
    Member
    Plugin Author

    Posted 1 year ago #

    Sure thing, I have started an issue here:

    https://github.com/parisholley/wordpress-asynchronous-javascript/issues/3

    I may get the itch to do it tonight, otherwise this weekend...

  4. Paris Holley
    Member
    Plugin Author

    Posted 1 year ago #

    this feature is now in 1.3.0

  5. Paul Thomson
    Member
    Posted 1 year ago #

    Hello Paris!

    Wow! Thanks so much for taking on board my suggestion and implementing it into the next release.

    When do you expect version 1.3.0 will be available via the WordPress Plugin repository?

    Regards,

    Paul

  6. Paris Holley
    Member
    Plugin Author

    Posted 1 year ago #

    It is therenow

  7. buddhatunes
    Member
    Posted 1 year ago #

    Hi, great plugin, but it is unclear to me how to exclude specific files. I tried this below on line 125 but cannot get the syntax right. Please let me know if you have any suggestions.

    function filter_headjs(){
    $options = get_option('asyncjs');
    $names = split(',', $options['exclude_name']);
    $files = split("jwplayer.js,jquery.flexslider.js,jquery.ui.totop.min.js,custom.js,swfobject.js" $options['exclude_js']);

  8. Paul Thomson
    Member
    Posted 1 year ago #

    buddahtunes,

    upgrade plugin to latest release, go into the plugin settings in wp-admin and add either the plugin name or javascript file... all pretty self explanatory. I can confirm working correctly, thanks to Paris!

    remove the code you posted it's not needed.

    Paul

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic