General developer forum

Adding JavaScript

This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Picture of Kevin Burton
Adding JavaScript

I am trying to follow the online documentation but I am running into some problems.


From my PHP file I do:

$PAGE->requires->yui_module('moodle-mod_mediasite-search', '');

But I get:

Uncaught TypeError: Cannot read property 'search' of undefined

The js file (in mod/mediasite/yui/src/search/js/search.js) looks like:


YUI.add('moodle-mod_mediasite-search', function(Y) {
var CSS = {

M.mod_mediasite = M.mod_mediasite || {};
NS = = {};

NS.baseurl = null; = null;

NS.init = function() {

. . . . .

Is it obvious what I am doing wrong?

Thank you.

Average of ratings: -