网页可见区域宽:document.body.clientWidth网页可见区域高:document.body.clientHeight网页可见区域宽:document.body.offsetWidth(包括边线的宽)网页可见区域高:document.body.offsetHeight(包括边线的宽)网页正文全文宽:document.body.scrollWidth网页正文全文高:documen...
window.onload=function(){functionlimit(){varendtime=newDate('2015/02/14,00:00:00'),nowtime=newDate(),theEnd=parseInt((endtime.getTime()-nowtime.getTime())/1000),t=document.getEleme...
functionsetCookieExpires(CookieName,expires){varexp='';if(expires==''){exp='';//expires不设置,浏览器关闭时过期}else{exp=newDate();exp.setTime(exp.getTime()+expires);//增加日期exp=";expi...
(function(){varbrowser='other',system='other',device='PC';varpf=navigator.platform,ua=navigator.userAgent,href=window.location.href;//埋点地址varroot='';//开关varON=false;//window系统匹...
window.onbeforeunload=function(){if(document.all){if(event.clientY<0){return"确定要离开吗?";}}else{return"确定要离开吗?";}}
functionisIE(){if(!!window.ActiveXObject||"ActiveXObject"inwindow){returntrue;}else{returnfalse;}}functionIEVersion(){varrv=-1;if(navigator.appName=='MicrosoftInternetExplorer'){varua...
functionis_pc(){varos=newArray("Android","iPhone","WindowsPhone","iPod","BlackBerry","MeeGo","SymbianOS");//其他类型的移动操作系统类型,自行添加varinfo=navigator.userAgent;varlen=os.length;for(vari=0...
//扩展Date的format方法Date.prototype.format=function(format){varo={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds()...
微信号:js_gcs大多数计算机语言,都有一个表示"无"的值,比如,C语言的NULL,Java语言的null,Python语言的none,Ruby语言的nil。有点奇怪的是,JavaScript语言居然有两个表示"无"的值:undefined和null。这是为什么?一、相似性在JavaScript中,将一个变量赋值为undefined或null,老实说,几乎没区别。vara=undefine...
javascript检测客户端是否安装了MSN,Skype,qq软件的通用方法代码如下:functioncheckInstalled(m){switch(m){case'msn':try{newActiveXObject("MSNMessenger.P4QuickLaunch");returntrue;}catch(e){returnfalse;}case'skype':tr...