jQuery核心函数jquery: "3.0.0-pre"

  1. jQuery(selector,context)
    1. 核心功能都是通过这个函数实现的,selector:用来查找的字符串,context:要查找字符串的范围,默认document;
    2. selector:可以是字符串”div”(return this.constructor(context).find(selector)),也可以是数组[“div”,”p”],还可以是函数$(function(e){console.log(e)//e为jQuery(selector,context)相当于selector(jQuery);})。还可以是对象{},返回的是数组。
    3. 调用路径
jQuery = function( selector, context ) {

        // The jQuery object is actually just the init constructor 'enhanced'
        // Need init if jQuery is called (just allow error to be thrown if not included)
        return new jQuery.fn.init( selector, context );
    }
    init = jQuery.fn.init=function(selector,context,root){};init.prototype = jQuery.fn;jQuery.fn.extend({find/filter/not/is})
  1. jQuery(html,props/这里可以写入属性,及一些事件/)
    1. 会创建html,还是通过主接口,通过判断是否有’<’尖括号,来判断是创建元素,还是搜索元素;
    2. props:是作为属性,事件加入
  2. jQuery(callback)
1. $(function(){   //文档就绪})
    console.log(document.readyState)//loading;
    $(function(){
        console.log(document.readyState)//interactive
    })
    console.log(document.readyState)loading;
    顺序是:loading,loading,interactive;
  1. jQuery.holdReady(hold)
    1. 没看明白,以后用到在记录吧
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值