jquery1.0
jquery1.0
a_gust_wind
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
2021-08-24
bind: function( type, fn ) { if ( fn.constructor == String ) fn = new Function("e", ( !fn.indexOf(".") ? "$(this)" : "return " ) + fn); jQuery.event.add( this, type, fn ); },event event: { // Bind an event to an element // Original by原创 2021-08-24 09:15:03 · 131 阅读 · 0 评论 -
jquery1.0 原型上的pushStack方法源码解读
248行到265行pushStack: function(a,args) { var fn = args && args[args.length-1]; //在一下情况进入第一个判断语句 //args不能是function {0:function(){},length:1;} {0:age,1:name,3:run,length:3}run = function(){} //可以是1,2,3 "sss" "" null undeinded {age:2,name:1,run原创 2021-07-27 20:18:36 · 151 阅读 · 0 评论 -
js 的push方法的伪代码
<script type="text/javascript"> var obj0 = {0:"李四",1:165,length:2} var obj1 = {height:20,age:10} var arr = [1,2,3,4] var arr1 = [9,11,22,33] var arr0 = [] arr0.push.apply(obj0,[1,2,3]) arr0.push.apply(obj1,[1,2,3]) console.log(obj0) console.原创 2021-07-26 17:35:39 · 552 阅读 · 0 评论 -
jquery1.0版本代码解读 each extend
13行 --window.undefined = window.undefined;–为了兼容ie5前的老版浏览区,老版本没有window.undefinde没有设定找的话window.undefinde就是undefinded值,再把这个undefinded值复制给window的子对象unfdeinfded,然后window={undefinded:undefinded}核心函数each ,extend,每次给原型jQuery.fn添加(extend)属性的都会用到extend函数jQuery.原创 2021-07-24 19:46:46 · 159 阅读 · 0 评论 -
jquery1.0 $(‘div).parent具体执行过程 还没写完
jQuery.macros = { to: { appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after" }, css: "width,height,top,left,position,float,overflow,color,background".split(","), filter: [ "eq", "lt", "gt", "contains" ],原创 2021-07-25 18:14:10 · 289 阅读 · 1 评论 -
jquery1.0 原型核心函数get方法解读
get: function( num ) { // Watch for when an array (of elements) is passed in 标记a if ( num && num.constructor == Array ) { // Use a tricky hack to make the jQuery object // look and feel like an array this.length = 0; [].push.apply(原创 2021-07-25 15:12:20 · 303 阅读 · 1 评论 -
jquery1.0 的$.map和$.merge方法详解
jQuery.extend({map: function(elems, fn) { // If a string is passed in for the function, make a function // for it (a handy shortcut) if ( fn.constructor == String ) fn = new Function("a","return " + fn); var result = []; // Go through t原创 2021-07-24 22:33:47 · 263 阅读 · 2 评论 -
jQuery $.extend 和 $.fn.extend 例子
$.extend({ }) 是在jQuery函数对象本身添加属性 访问直接 $.或者jQuery$.fn.extend({}) 是在jQuery函数对象的原型上添加属性 访问是jQuery对象访问 $()或者jQuery()html代码<!DOCTYPE html><html> <head> <meta charset="utf-8">原创 2021-07-21 13:58:42 · 148 阅读 · 0 评论
分享