**什麼是 JavaScript 回撥函式?**


**示例**

<html>
   <head>
      <script>
         var callback = function(myCallback) {
            setTimeout(function() {
               myCallback();
            }, 5000);
         };
         
         document.write("First is displayed");
         document.write("<br>Second is displayed");
         
         callback(function() {
             document.write("This is Callback function");
         });
         document.write("<br>Last is displayed");
      </script>
   </head>
</html>

360 個瀏覽量

開啟 職業生涯

完成課程以獲得認證

開始
廣告
© . All rights reserved.