Running a function just before $(document).ready() triggers

前端 未结 3 1386
不知归路
不知归路 2021-02-20 04:02

I\'ve attached multiple functions in multiple files to $(document).ready and would like to attach a single function to happen before them as either the first that $(document).re

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-20 04:37

    I just had the exact same problem. I put a tiny script on GitHub that adds a $.beforeReady() function. Funny :)

    https://github.com/aim12340/jQuery-Before-Ready

    Just load the script right after jQuery like in this example:

    
        
            
            
        
        
            
                    
        
    
    

提交回复
热议问题