Got some routines you want to run through ajax but don't know where to put them? Me too.
This requires logon and expects three parameters at least:
- action - to switch the lookup
- id - the course id
- sesskey - which you get from php sesskey()
Call it somehow
require(['jquery',function($) {
$.post('/local/ajax.php', {
'action':'activitycompletion',
'id':courseId,
'sesskey':sesskey
}).done(function(result) {
console.dir(result);
});
}]);
GPL3