shueixue

jQuery文档加载事件

  • $(document).ready(handler)
    $().ready(handler) (this is not recommended)
    $(handler)
    
    相当于:
    $(document).ready(function(){})
    $().ready(function(){}) (this is not recommended)
    $(function(){})
    

      只要DOM结构已完全加载时,脚本就可以运行。传递处理函数给.ready()方法,能保证DOM准备好后就执行这个函数,因此,这里是进行所有其它事件绑定及运行其它 jQuery 代码的最佳地方。

分类:

技术点:

相关文章:

  • 2021-10-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2021-11-19
  • 2021-11-19
  • 2021-08-17
猜你喜欢
  • 2021-12-27
  • 2022-02-05
  • 2021-08-19
  • 2021-10-12
  • 2021-10-06
  • 2021-11-18
相关资源
相似解决方案