How do you make an event listener that detects if a boolean variable becomes true?

前端 未结 7 2059
-上瘾入骨i
-上瘾入骨i 2020-12-31 19:52

For example, I have var menu_ready = false;. I have an ajax function that sets menu_ready to true when the ajax stuff is done:

//se         


        
7条回答
  •  既然无缘
    2020-12-31 20:26

    function menuReady(){
      // Do whatever it is you need done when menu is ready
    }    
    
    $(...).load(..., function() {
      menuReady();// menuReady is called on callback    
    });
    

提交回复
热议问题