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

后端 未结 12 1620
后悔当初
后悔当初 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:10

    Following Zakas' The art of throwing JavaScript errors, I began to throw my own errors in JavaScript as an approach to finding JS issues.

    But this approach unfortunately started causing the jQuery ready() functions to silently fail, for unrelated parts of the site. :(

    I learned that the following are different:

    throw new Error()
    

    is different from

    console.error()
    

    So, I started to use console.error(), and I still got the red highlighting in the console.

提交回复
热议问题