How to combine multiple jquery functions

前端 未结 5 573
谎友^
谎友^ 2021-02-06 10:40

If you view the jquery code below you will see the famous $(document).ready(function(){ that starts the script off. I see this on pretty much all jquery code e

5条回答
  •  孤城傲影
    2021-02-06 11:05

    I think the original poster was asking if he must do this:

    
    
    

    Or if he can just do this:

    
    

    In the later example, there is one script and one document ready statement. Much cleaner. I believe the answer is yes, you can do the later without any problem.

提交回复
热议问题