源码96-280行 前言 上一篇说到了jQuery的extend方法,它是用来给jQuery函数扩展方法或者给jQuery的原型上加方法。 其实上,jQuery的原型上还是有一些属性和方法的。其中就有我们熟悉的init方法。 当我们调用 $("li") 时,new的便是jQuery.prototyp ...
分类:
Web程序 时间:
2020-05-18 00:30:52
阅读次数:
59
上一篇写到了jQuery.prototype对象的init方法,因为init方法内容较多,因此弄了个上下篇 先列一下jQuery.prototype对象上的方法与属性吧 jQuery.fn = jQuery.prototype = { jquery: core_version, // 49行 cor ...
分类:
Web程序 时间:
2020-05-18 00:19:32
阅读次数:
79
我们知道Promise是javaScript中异步编程的一种解决方法。那Promise的诞生解决了哪些问题呢?
...
分类:
其他好文 时间:
2020-05-16 19:05:00
阅读次数:
77
JavaScript中可以在某个元素前使用 '+' 号,这个操作是将该元素转换成Number类型,如果转换失败,那么将得到 NaN +new Date() 将会调用 Date.prototype 上的 valueOf() 方法,根据MDN,Date.prototype.value方法等同于Date. ...
分类:
Web程序 时间:
2020-05-16 17:04:37
阅读次数:
137
写一段JS代码,按下面的方式实现plus和minus方法: var a = (7).minus(2).plus(1); console.log(a)//输出6。 既实现:(7).plus(2).minus(1);结果为6的代码; Number.prototype.plus = function(n) ...
分类:
其他好文 时间:
2020-05-16 10:46:11
阅读次数:
45
Function prototype in C programming: Importance Function prototype in C is used by the compiler to ensure whether the function call matches the return ...
分类:
其他好文 时间:
2020-05-16 00:28:14
阅读次数:
61
jQuery工具方法$.Deferred()简单实现: (function () { //创建一个jQuery构造函数 function jQuery(selector) { return new jQuery.prototype.init(selector); } //为jQuery的原型添加in ...
分类:
Web程序 时间:
2020-05-16 00:21:12
阅读次数:
76
jQuery工具方法$.Callbacks()的简单实现: (function () { //创建一个jQuery构造函数 function jQuery(selector) { return new jQuery.prototype.init(selector); } //为jQuery的原型添加 ...
分类:
Web程序 时间:
2020-05-15 23:03:59
阅读次数:
112
方法1:使用插件pdfObject(Safari不能正常显示,安卓手机的支持也不好) npm i pdfobject -S main.js Vue.prototype.$PDFObject = PDFObject; <div id="example1" style="height:600px;wid ...
分类:
其他好文 时间:
2020-05-15 17:52:32
阅读次数:
197
1.数据库使用的数据类型是datetime 2.使用这种方式显示数据发现会出现这么个问题,以这样的格式输出"/Date(xxxxxxxxxxxxx)/"。 3.解决方法,写一个方法用来解析JSON格式的时间 Date.prototype.format = function (format) //au ...
分类:
Web程序 时间:
2020-05-14 21:03:16
阅读次数:
203