- 博客(6)
- 收藏
- 关注
原创 怎样设置max-age或expires来缓存你的站点文件
方法: 详情: Cache-control用于控制HTTP缓存(在HTTP/1.0中可能部分没实现,仅仅实现了Pragma: no-cache)数据包中的格式:Cache-Control: cache-directivecache-directive可以为以下:request时用到:| “no-cache” | “no-store” | “max-age” “=” delta-secon
2016-05-28 23:10:21
714
转载 grunt使用小记
grunt使用小记之uglify:最全的uglify使用DEMO grunt-contrib-uglify uglify是一个文件压缩插件,项目地址:https://github.com/gruntjs/grunt-contrib-uglify 本文将以一个DEMO来展示如何使用uglify插件。 DEMO环境 package.json: { "name
2016-03-11 11:51:21
331
转载 删除Array重复元素的方法
删除Array重复元素的方法:像其它的语言一般都有标准方法,可Javascript天生就没有标准的方法,我们可以能过Prototype这个属性给Array添加一个我们自己的方法,使用的时候可以像使用toString() valueOf() ….等等一样,很实用,其实大家还可以添加其它的方法,比较Sting的去除首尾空格,去除HTML标签,我的Javascript库里有,喜欢的朋友可以去看一下。好
2016-01-22 13:51:30
518
转载 欢迎使用优快云-markdown编辑器
//封装StringBuilderfunction StringBuilder() { this.string = new Array(); }StringBuilder.prototype.Append = function (str) { this.string.push(str); }StringBuilder.prototype.toString = function () { return
2016-01-22 11:12:14
382
翻译 JS- 封装、继承、多态
1 function myfun1(){ 2 //这是私有属性 3 var private1 = "这是私有属性"; 4 var privateMethod = function(){ 5 alert(private1); 6 } 7 //这是实例属性 8 this.publicvar = "这是实例属性"
2016-01-22 11:05:24
568
转载 JS使用模板快速填充HTML控件数据
先写个非常重要的JS方法,此方法就是用来填充格式数据的。(看不懂也没关系,会用就行) Js代码 收藏代码 function formatTemplate(dta, tmpl) { var format = { name: function(x) { return x } }; return tmpl.r
2015-09-17 10:15:34
757
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人