2016年12月4日
摘要: Javascript中的继承一直是个比较麻烦的问题,prototype、constructor、__proto__在构造函数,实例和原型之间有的复杂的关系,不仔细捋下很难记得牢固。ES6中又新增了class和extends,和ES5搅在一起,加上平时很少自己写继承,简直乱成一锅粥。不过还好,画个图一 阅读全文
posted @ 2016-12-04 14:12 1883808 阅读(563) 评论(0) 推荐(0)
  2016年12月3日
摘要: jQuery.fn jQuery.fn = jQuery.prototype = { init: function( selector, context ) {//…. //…… }; 原来 jQuery.fn = jQuery.prototype.对prototype肯定不会陌生啦。 虽然 jav 阅读全文
posted @ 2016-12-03 22:33 1883808 阅读(203) 评论(0) 推荐(0)
摘要: 例子如下:(function($) { var compiled = {}; $.fn.handlebars = function(template, data) { if (template instanceof jQuery) { template = $(template).html(); } 阅读全文
posted @ 2016-12-03 22:23 1883808 阅读(373) 评论(0) 推荐(0)
摘要: 最近在研究jQuery。把jQuery.extend扩展函数的用法记录下来。1、扩展jQuery静态方法. 1$.extend({2test:function(){alert('test函数')}3}) 用法: $.test() 2、合并多个对象.为jQuery.extend(css1,css2)为 阅读全文
posted @ 2016-12-03 16:15 1883808 阅读(116) 评论(0) 推荐(0)
  2016年12月2日
摘要: 1) 解析HTML结构。 (2) 加载外部脚本和样式表文件。 (3) 解析并执行脚本代码。 (4) 构造HTML DOM模型。//ready执行 (5) 加载图片等外部文件。 (6) 页面加载完毕。//load执行 阅读全文
posted @ 2016-12-02 07:31 1883808 阅读(147) 评论(0) 推荐(1)
  2016年12月1日
摘要: var html = 'fdsafds<img src=fdsaf>fdsafdsaf<img src=fdsaf>'; var imgs = html.match(/<img[^>]+>/g); document.getElementById('test').innerHTML = imgs.jo 阅读全文
posted @ 2016-12-01 17:44 1883808 阅读(244) 评论(0) 推荐(0)
  2016年11月30日
摘要: 链接地址:http://www.cnblogs.com/know/archive/2011/10/09/2204005.html 前天在项目中写的一个ajax jsonp的使用,出现了问题:可以成功获得请求结果,但没有执行success方法,直接执行了error方法提示错误——ajax jsonp之 阅读全文
posted @ 2016-11-30 15:43 1883808 阅读(99) 评论(0) 推荐(0)
摘要: <div style="height: 0.6rem"> <span style="display: inline-block; height: 100%; vertical-align: top;"></span> <button style="vertical-align: top;">查看物流 阅读全文
posted @ 2016-11-30 09:11 1883808 阅读(132) 评论(0) 推荐(0)
  2016年11月28日
摘要: var txt = '{ "sites" : [' + '{ "name":"驿科教程" , "url":"www.runoob.com" },' + '{ "name":"google" , "url":"www.google.com" },' + '{ "name":"微博" , "url":&qu 阅读全文
posted @ 2016-11-28 20:05 1883808 阅读(96) 评论(0) 推荐(0)
摘要: data=(new Function("console.log('dsfsf')"))() 阅读全文
posted @ 2016-11-28 15:08 1883808 阅读(94) 评论(0) 推荐(0)