Support » Plugin: Flying Scripts by WP Speed Matters » Script depending to other

  • Resolved roryrory

    (@roryrory)


    Hello
    Very very good plugin that greatly improve speed of website.
    Just one option which can be interested to develop is the loading of script that depends to other.
    For example jqueryui depends on jquery. So if jqueryui is loaded when jquery is not finnished to be fully loaded then the jqueryui scripts will not work and induce errors.
    One solution i used before was to have a callback function that executed once the first script is loaded. So inside the document.body.appendChild(myScript);
    myScript.onreadystatechange = callback;
    myScript.onload = callback;
    For each script in the include keywords, it can be interested to get the possibility to add depends scripts.
    What do you think the plugin developpers?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter roryrory

    (@roryrory)

    I think this option is of first importance as more than 90% of wordpress install used scripts that depends of jquery.

    Plugin Author Gijo Varghese

    (@gijo)

    @roryrory if you’ve delayed jqueryui without delaying jquery, jqueryui will be executed only after jquery is fully loaded. Assuming they’re in the correct order in HTML.

    If you’re facing issues, pls provide a test website with steps to reproduce.

    Thread Starter roryrory

    (@roryrory)

    Jquery and jqueryui are just an example. And i don’t have any issue with your amazing plugin.
    But for example if we want to delay jqueryui and a script using jqueryui library.
    In the wordpress wp_register_script function, there is such priority using the 3rd argument $deps.
    Is the orders respected, and the loading of dependent script done only when the parent script is fully loaded?

    Plugin Author Gijo Varghese

    (@gijo)

    @roryrory the order is preserved even if you delay a script. I don’t think that will be an issue. Never seen any user having issues like that.

    Thread Starter roryrory

    (@roryrory)

    ok thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.