Akhilesh
Akhilesh

Reputation: 1313

jQuery not working in Moodle theme

I am using Moodle 3.1+. I am trying to develop a custom theme. In my theme jQuery is not working. I have tried by using $THEME->javascripts_footer in theme config.php file and $PAGE->requires->js() in frontpage.php. Please help

Upvotes: 0

Views: 2313

Answers (2)

Ibrahim Isa
Ibrahim Isa

Reputation: 619

Try adding this line as a page setting on top

$PAGE->requires->jquery();

Upvotes: 1

Mary Evans
Mary Evans

Reputation: 11

Time has past since you asked for help, so I guess you have found the answer? For anyone else finding this post, then they will be happy to learn that Moodle 3.1 already uses jQuery. So if your theme is based on the Moodle default theme, which is Bootstrapbase, then there is nothing you need to do.

If your theme is not based on the Moodle default theme, then you need to read this Moodle Doc: jQuery

Upvotes: 1

Related Questions