In the new version of jquery, the live() method has been deleted, so when we call it, we will be prompted that the function does not exist and js will report an error.
The solution is to use the on() function to replace it.
The original writing is:
If it is directly replaced with the on() method, then the newly generated element Clicking the event again will not have any effect. The new syntax is:
This involves a question, why is $("body") here the body? In fact, we can choose other distances# The node that is closer to company_logo will have better performance. In fact, on() is to find the #company_logo node in the body, so we replace the body with the superior node of #company_logo to achieve better performance.