$THEME->javascripts_footer = array('pusher.min');
But is not working. I want to integrate Pusher into Moodle and for that, I have to load the script from URL 'https://js.pusher.com/3.2/pusher.min.js'.
I am using Moodle 3.1+. I want to load javascript from an external URL
into Moodle. I have tried adding it through config file of theme using
Pusher AMD modules are available here: https://github.com/pusher/pusher-js/tree/master/dist/web
You can try the following method. Create a folder named javascript in your theme. Download and copy the pusher.min.js file in it. Now write $THEME->javascripts_footer = array( 'pusher.min' ); in the config file if you want to include the script into the footer [recommended] else use $THEME->javascripts = array( 'pusher.min' ); If you want to load it into the header.
If you want to include jQuery within the page header you will need to specify true as the second argument.
$PAGE->requires->js('path/to/plugin/javascript/jquery-1.4.2.min.js', true);
Documentation link : https://docs.moodle.org/dev/Using_jQuery_with_Moodle
Hope this helps.
Regards,
Purnendu
I included the javascript file in the layout file of moodle.
And it worked for you?
Yes. It worked.