js 回调 callback
<html> <head> <title>按钮点击事件示例</title> <script> function a(callback) { console.log("执行函数a!"); console.log("调用回调函数"); callback(); // 调用回调函数 } function b(){ console.log("回调函数b"); } function c() { console.log("回调函数c"); } function execute(){ a(b); a(c); } <!-- execute(); --> </script> </head> <body> <button onclick = "execute()">回调函数</button> </body> <html>