$(function(){})

function中的代码在DOM加载完成后立即执行,比window.onload()更快,因为前者不需要等待图片加载完成。

(function($){})(jquery)

声明了一个匿名函数,声明完成后立即调用;相当于function a(arg){}; a(jquery);

随机推荐

  1. Spring batch的学习

    Spring batch是用来处理大量数据操作的一个框架,主要用来读取大量数据,然后进行一定处理后输出成指定的形式. Spring batch主要有以下部分组成: JobRepository     ...

  2. nginx configuration

    Now that you know how to manage the service itself, you should take a few minutes to familiarize you ...

  3. 安装ceres-solver

    安装依赖: sudo apt-get install -y google-mock libboost-all-dev libeigen3-dev libgflags-dev libgoogle-glo ...

  4. VS2010_x86_编译错误

    1.两个头文件 相互include 报出来的错误,没有直接说是 嵌套include,而是这个现象: error: C4430: 缺少类型说明符 - 假定为 int.注意: C++ 不支持默认 int ...

  5. php 四种基础排序

    1. 冒泡排序算法 *     思路分析:法如其名,就是像冒泡一样,每次从数组当中 冒一个最大的数出来.  *     比如:2,4,1    // 第一次 冒出的泡是4  *             ...

  6. Codeforces 899E - Segments Removal

    899E - Segments Removal 思路:priority_queue+pair 代码: #include<bits/stdc++.h> using namespace std ...

  7. Codeforces 735B - Urbanization

    735B - Urbanization 思路:贪心.人数少的城市住钱最多的那几个人. 不证明了,举个例子吧:a1<a2<a3<a4<a5 (a1+a2+a3)/3+(a4+a5 ...

  8. WPF使用Webbrowser操作网页的主要代码

    1,引用mshtml.dll using mshtml; 2,获取元素属性值 IHTMLDocument2 doc2=(IHTMLDocument)webbrowser1.Document; IHTM ...

  9. 12月13日 什么是help_method,session的简单理解, find_by等finder method

    helper_method Declare a controller method as a helper. For example, helper_method :link_to def link_ ...

  10. Rspec: feature spec 功能测试 测试JavaScript.

    我们要把应用各组件放在一起做集成 测试,这样才能保证模型和控制器之间能够良好契合. 在 RSpec 中,这种测试称为功能测试(feature spec),有时也称为验收测试(acceptance te ...