Hi all,
I have a client that would like to use javascript within lessons to add a bit of functionality like mouse over effect. Or clicking on a button will update some text on that same page.
Anyway, editing a page, then going into HTML view, and putting in some javascript like:
<script type="text/javascript">// <![CDATA[
var i=0;
for (i=0;i<=5;i++)
{
document.write("The number is " + i);
document.write("<br />");
}
// ]]></script>
works fine. Calling functions doesn't seem to work though because I'll need to have the function defined in the <head> section. How do I do that? Edit the theme file?
What is the best way to go about integrating javascript into Moodle? I've read this http://docs.moodle.org/dev/JavaScript_guidelines but I'm not fully getting it all. I really only want to do some pretty basic things. So the key is to be able to define functions, and call them from within a block of HTML as in a lesson.
thanks!
Andrew