Javascript examples for Function:Function Async
Create your own async function handler
<html> <head> <meta name="viewport" content="width=device-width"> </head> <body> <script> function asyncFunction(time, callback){ setTimeout(function() {// w ww . ja va 2 s . c om callback('Bye!') }, time); } function getMessage(){ console.log('Hello!'); asyncFunction(2000, function(message){ console.log(message); }); } getMessage(); </script> </body> </html>