Hi Everyone,
As we all know how we can add AMD code in moodle page by PHP,
$PAGE->requires->js_call_amd($modulename, $functionname, $params);
But I need to do this by JavaScript, because I have a local plugin vm_chat(footer chat). The index.php of it has
$PAGE->requires->js_call_amd('local_vmchat/index', 'init', [$CFG->wwwroot.'/']
By this, the footer chat would display only in 'chat plugin' page, but it should display throughout the site.
If I can add this by JavaScript like from Additional HTML page (Dashboard ► Site administration ► Appearance ► Additional HTML), then the chat would display throughout site.
How can I add AMD code in moodle page by javaScript?
Or any other suggestion ? You guys may please share.
Thank you