随笔分类 -  JS

继承
摘要:function shipDensity(map){ monitorParent.call(this, map); var that = this; this._indexHistoryChart; this.createStationMarker = function(){} } function 阅读全文
posted @ 2017-02-08 11:16 路过的二师兄 阅读(95) 评论(0) 推荐(0)
clone
摘要:function clone(obj){ var o; switch(typeof obj){ case 'undefined': break; case 'string' : o = obj + '';break; case 'number' : o = obj - 0;break; case ' 阅读全文
posted @ 2017-02-08 11:16 路过的二师兄 阅读(105) 评论(0) 推荐(0)
冒泡排序
摘要:加强版 冒泡排序 一个数组跟随另一个数组(长度相同的)排序 //comparator 比较器规则 第二个大于第一个 返回1 : < 1, = 0, > -1//实现接口 比较定制化对象function objArrComparator(sortA,sortB){ if(Number(sortA.va 阅读全文
posted @ 2017-02-08 10:19 路过的二师兄 阅读(219) 评论(0) 推荐(0)
Map迭代器
摘要://map 迭代器对象/* 例子; var map_itr = new _iterator(map); while(map_itr._has_next()){ var entry = map_itr._next(); print(entry.key); print(entry.value); }*/ 阅读全文
posted @ 2017-02-08 10:13 路过的二师兄 阅读(1472) 评论(0) 推荐(0)
js笔记
摘要:JQuery插件模板 //You need an anonymous function to wrap around your function to avoid conflict (function($){ //Attach this new method to jQuery $.fn.exten 阅读全文
posted @ 2016-05-30 14:07 路过的二师兄 阅读(374) 评论(0) 推荐(0)
文件下载及web文件的contentType类型大全
摘要:String filePath=""; File file=new File(filePath); //解决乱码问题 String filename=URLEncoder.encode(file.getName(),"utf-8"); //重置输出流 response.reset(); Respon 阅读全文
posted @ 2016-02-21 10:08 路过的二师兄 阅读(15990) 评论(0) 推荐(1)
自己写的分页js分页插件 很low很实用
摘要:var paginator = function(){ this.number_of_pages; this.show_per_page; this.number_of_items; this.tab1_current_page; this.paginatorHelp; this.in... 阅读全文
posted @ 2016-01-09 12:38 路过的二师兄 阅读(288) 评论(0) 推荐(0)
全面理解Javascript闭包和闭包的几种写法及用途
摘要:一、什么是闭包和闭包的几种写法和用法 1、什么是闭包闭包,官方对闭包的解释是:一个拥有许多变量和绑定了这些变量的环境的表达式(通常是一个函数),因而这些变量也是该表达式的一部分。闭包的特点: 1. 作为一个函数变量的一个引用,当函数返回时,其处于... 阅读全文
posted @ 2016-01-09 10:51 路过的二师兄 阅读(133) 评论(0) 推荐(0)