Labs/F1/Modularity/WebMod HOWTO: Difference between revisions

Jump to navigation Jump to search
Line 47: Line 47:
  <head>
  <head>
   <script src="jquery.js" />
   <script src="jquery.js" />
 
   <!-- the following script provides WebMod API bindings -->
   <!-- the following script provides WebMod API bindings -->
   <script src="https://webmods.mozilla.org/js/include.js" />
   <script src="https://webmods.mozilla.org/js/include.js" />
Line 60: Line 60:
       callback({'status': 'ok', 'displayname': 'Bob Smith', 'username' : 'bobsmith'});
       callback({'status': 'ok', 'displayname': 'Bob Smith', 'username' : 'bobsmith'});
     });
     });
 
     // webmod API call
     // webmod API call
     WebMod.onCall(function(func_name, args, callback) {
     WebMod.onCall(function(func_name, args, callback) {
       // implement the function
       // implement the function
 
       // return any expected result via the callback
       // return any expected result via the callback
       callback(result);
       callback(result);
668

edits

Navigation menu