brief question about elgg_load_js().

Hi everyone.

If I use elgg_register_js(.....) in a plugin, Can I use  elgg_load_js in a view of another plugin?

Thanks...

  • Absolutely.

    The only thing to keep in mind is if the plugin supplying the js is deactivated then there will be nothing to load.  If this is something that's required then you can declare the second plugin as being dependent on the first in the manifest.xml

    It'll look something like this:

    <requires>

        <type>plugin</type>

        <name>js_provider_plugin</name>

        <version>1.3</version>

    </requires>

  • Thanks Matt, then I'm doing something wrong in one of my plugins. I'll try to find my error.