Why is $(document).ready not firing for me?

后端 未结 12 1602
后悔当初
后悔当初 2020-12-10 00:26

In a php file i have used include to include the following js.php file and prior to that i have included the jquery file.



        
12条回答
  •  时光说笑
    2020-12-10 01:26

    Another cause that will silently fail, and all remaining callbacks never called:

    $(document).ready(null);
    

    So check if you have variables or syntax errors that return null. Like this one:

    $(document).ready(function($){}(jQuery));
    

    Notice that the function above is called instantly and undefined is returned.

提交回复
热议问题