browser_amd.html (598B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>typed-function | basic usage with amd</title> 5 <script src="http://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.15/require.min.js"></script> 6 </head> 7 <body> 8 9 <script> 10 // load math.js using require.js 11 require(['../typed-function.js'], function (typed) { 12 // create a typed function 13 var fn1 = typed({ 14 'number, string': function (a, b) { 15 return 'a is a number, b is a string'; 16 } 17 }); 18 19 // use the function 20 document.write(fn1(2, 'foo') + '<br>'); // outputs 'a is a number, b is a string' 21 }); 22 </script> 23 24 </body> 25 </html>