jQuery文档就绪函数 [英] jQuery document ready functions

查看:401
本文介绍了jQuery文档就绪函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下jQuery文档就绪函数有什么不同(如果有的话):

what are the differences (if any) for the following jQuery document ready functions:

$(document)。ready(function) (){}); $(function(){});

推荐答案

它们是等价的,后者是第一个的简写形式。

They are equivalent, the later is a shorthand form for the first.

来自jQuery文档


以下所有三种语法都是等效的:

All three of the following syntaxes are equivalent:

$(document).ready(handler)
$().ready(handler) (this is not recommended)
$(handler)


这篇关于jQuery文档就绪函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆