WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to avoid repetitive calls? (4 posts)

  1. Rok
    Member
    Posted 7 years ago #

    These days most of the plugins are using prototype & Script.aculo.us js. Prototype is now bundled with WordPress version 2.1 onwards. In this case, if you're using six plugins that use either of these js, then the js is loaded six times.

    Just want to know, is there any plugin that can look for the specified javascripts, and if found loaded can avoid further loading by other plugins?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    In this case, if you're using six plugins that use either of these js, then the js is loaded six times.

    Then you need to update those plugins to not load protoype.js and such, but to use the wp_enqueue_script() functions instead.

    With the addition of these javascripts into WordPress comes a javascript handling system. A plugin (or anything else) can add specific scripts to the system, define dependencies and such, and have them loaded into the page. The code doing this will load scripts in the correct order and it will also avoid duplicates.

    Any plugin loading javascripts the old way is probably not fully 2.1 compatible and needs to be modified to use the new mechanisms.

  3. Rok
    Member
    Posted 7 years ago #

    Whoosh! sooooooooo simple....thanks Otto42.

  4. Rok
    Member
    Posted 7 years ago #

    I've made a detailed post on this issuse, if anyone else is facing the same problem, read this post.

Topic Closed

This topic has been closed to new replies.

About this Topic