Generico button no longer works

Re: Generico button no longer works

by Justin Hunt -
Number of replies: 1
Picture of Particularly helpful Moodlers Picture of Plugin developers
If you want me (or someone ) to check your code its a good idea to allow us to copy and paste it. What you posted was a screenshot of the source and I won't have time to type it out and debug it. You can use the pre-formatted text formatting option when copying-and-pasting code  into the html area. (Then it looks a bit like code and doesn't go all massive)


I am not sure what that error is but generally speaking, you should put the javascript into the custom js area of the template. Then it will load it in an AMD module and it works a lot nicer like that. The attached template bundle will do something like what you are doing.  I hope it gives you some ideas.

(You can just drag the template bundle over the green bundle box on a template settings page and it will autofill the template fields.)
In reply to Justin Hunt

Re: Generico button no longer works

by Thies Osterwold -
sorry so here comes the code:
<ul id="nav-one" class="nav">
<li>
<a href="#">Home</a>
<audio id="beep-one" controls="controls" preload="auto">
<source src="https://ourserver.com/draftfile.php/5/user/draft/159357818/file_example_MP3_700KB.mp3"> </audio>
</li>
</ul> <script type="text/javascript"> var beepOne = $("#beep-one")[0]; $("#nav-one a").click(function() {
beepOne.play();
}); </script>