热门关键字:
原生javascript操作cookie和日期格式的通用方法

原生javascript操作cookie和日期格式的通用方法functionsetCookie(name,value){varDays=1;varexp=newDate();exp.setTime(exp.getTime()+Days*24*60*60*1000);exp.setHours(0);exp.setMinutes(0);exp.setSeconds(0);...

1584
2015/10/19 14:45:46
0
View Details
javascript常用的Date对象扩展

javascript常用的Date对象扩展Date.getDaysInMonth=function(year,month){vardays=0;switch(month){case1:case3:case5:case7:case8:case10:case12:days=31break;case4:case6:case9:case11:days=30...

956
2015/5/26 13:18:50
0
View Details
javascript常用的String对象扩展

javascript常用的String对象扩展<scripttype="text/javascript">if(typeofString.prototype.ltrim=='undefined'){String.prototype.ltrim=function(){vars=this;s=s.replace(/^\s*/g,'');returns;}}if(typeofS...

983
2015/5/26 13:16:45
0
View Details
分享原生JavaScript技巧大收集(51~60)

51、原生JavaScript获取页面可视高度functiongetPageViewHeight(){vard=document,a=d.compatMode=="BackCompat"?d.body:d.documentElement;returna.clientHeight;}52、原生JavaScript跨浏览器添加事件functionaddEvt(oTarget...

3947
2013/8/5 22:31:49
0
View Details
JavaScript中的prototype使用说明详解

1、prototype在JavaScript中并没有类的概念,但JavaScript中的确可以实现重载,多态,继承。这些实现其实方法都可以用JavaScript中的引用和变量作用域结合prototype来解释。2、简单的例子varBlog=function(name,url){this.name=name;this.url=url;};Blog.protot...

2172
2012/8/31 13:54:35
0
View Details