General developer forum

jQuery & jQuery UI in Moodle 3.4

Picture of Justin Hunt
Re: jQuery & jQuery UI in Moodle 3.4
Particularly helpful MoodlersPlugin developers

If the JQuery plugins are AMD compatible, you should just be able to include them as dependencies normally. 

See this post regarding loading JQuery UI (which arejquery plugins)

If they are not, then life is a bit harder. I use $.getScript from within the AMD module itself to load the plugin. You probably also need some plumbing to make sure we only load the library once.  Here is an example from the Fancybox generico template...

 $.getScript('', function(){
     //do something with the newly loaded plugin
Average of ratings: -