//获取终端的相关信息varTerminal={//辨别移动终端类型platform:function(){varu=navigator.userAgent,app=navigator.appVersion;return{//是否为iPhone或者QQHD浏览器iPhone:u.indexOf('iPhone')>-1,//是否iPadiPad:u.i...
功能:原生javascript检测是否移动设备访问包括了45种代码如下:functioncheckMobile(){varpda_user_agent_list=newArray("2.0MMP","240320","AvantGo","BlackBerry","Blazer","Cellphone","Danger","DoCoMo","Elaine/3.0","...
功能:原生javascript利用正则表达式获取url的参数值function代码如下:functiongetParam(url,name){varsearch=document.location.search;varpattern=newRegExp("[?&]"+name+"\=([^&]+)","g");varmatcher=pattern.exec(url);var...
javascript面向对象编程术语Namespace命名空间允许开发人员在一个独特,应用相关的名字的名称下捆绑所有功能的容器。Class类定义对象的特征。它是对象的属性和方法的模板定义.Object对象类的一个实例。Property属性对象的特征,比如颜色。Method方法对象的能力,比如行走。Constructor构造函数对象初始化...
/***@Descriptionmap将图片文件转化为字节数组字符串,并对其进行Base64编码处理*@authortemdy*@Date2015-01-26*@parampath图片路径*@return*/publicstaticStringimageToBase64(Stringpath){//将图片文件转化为字节数组字符串,并对其进行Base64编码处理byt...
网页可见区域宽: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"确定要离开吗?";}}