1.Jquery Utility
<1> Type & Function & setTimeOut
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script src="../../jquery/jquery-3.2.1.min.js"></script> </head> <body> <h1>Type test Functions demo</h1> <div id="output"></div> <script type="text/javascript"> function addText() { $(‘#output‘).append(‘HelloWorld<br>‘); } function callAnotherFunction(times, delay, func) { var otimes = $.isNumeric(times)? times:3; var odelay = $.isNumeric(delay)? delay:300; if(!$.isFunction(func)){ return false; } var i = 0; (function loopIt() { i++; func(); if(i<times){ setTimeout(loopIt,delay); } })(); } $(document).ready(function () { callAnotherFunction(3,300,addText); }) </script> </body> </html>