本文介绍了jquery文档的入口点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在每个JQuery教程中,入口点总是如下:
In every JQuery tutorial the entry point is always like this:
$(document).ready(function() {
...
});
但是在项目对于我的新手来说,它有不同的切入点。
这是代码片段和完整档案:
But in sdoc project it has different entry point as for my novice's view.Here's the code snippet and there the full file:
<script type="text/javascript" charset="utf-8">
//<![CDATA[
function placeholder() {
...
}
$(function() {
placeholder();
...
})
//]]>
</script>
问题: $(function()..)
jquery脚本的入口点?如果它与传统方法有所不同?谢谢
The question: Is $(function()..)
the entry point for jquery script? And if it does why it differ from traditional approach? Thanks
推荐答案
它是一样的。来自:
$(document).ready(handler)
$().ready(handler) (this is not recommended)
$(handler)
这篇关于jquery文档的入口点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!