User Tools

Site Tools


training_library

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
training_library [2019/04/01 16:55] lucytraining_library [2019/04/05 16:17] lucy
Line 132: Line 132:
 In order to associate an event with a button, you can do this within the HTML code: In order to associate an event with a button, you can do this within the HTML code:
  
-Eample 1+Button Example 1
   <button onclick="lucyDispatchEvent('some string')"> Some button </button>   <button onclick="lucyDispatchEvent('some string')"> Some button </button>
  
-Example 2:+Button Example 2:
   <button onclick="buttonfunc()">   <button onclick="buttonfunc()">
   Some button   Some button
Line 145: Line 145:
   }   }
   </script>   </script>
 +  
 +**Automatic Start Example** (in this example an notification about the course name that gets started is sent automatically to LUCY upon opening of the first page). Please insert this script into the index.html page (can be in header or body. It is important to insert it before the body close tag (/body>).
 +
 +  <script>
 +  $(function () {
 +  lucyDispatchEvent("Course: your_course_name started"); });
 +  </script>
 +
 +jQuery requirements: In most templates, jQuery is already connected.
 +
 +If  a  line  like the examples below is already in the index.html file, then nothing else needs to be done. Look for:
 +
 +  <script src="%static%/jquery-1.11.3.min.js"></script>
 +  
 +or
 +
 +  <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
 +  
 +
 +If you dont have jQuery in the template, you can use those versions:  
 +
 +  * jquery-1.11.3.min.js
 +  * jquery.js 
 +  * jquery-2.4.min.js
 +
 +All those version can be downloaded from here:
 +https://jquery.com/download/
  
training_library.txt · Last modified: 2021/10/18 15:16 by lucysecurity