热门关键字:
原生javascript动态设置页面头部声明内容

原生javascript动态设置页面头部声明内容<metaname="apple-itunes-app"content="app-id=458318329"/><script>if(navigator.userAgent.match(/iPad/i)){document.getElementsByName('apple-itunes-app')[0].setAttribute('co...

909
2015/5/5 13:15:21
0
View Details
javascript获取终端的相关信息跳转不同页面

//获取终端的相关信息varTerminal={//辨别移动终端类型platform:function(){varu=navigator.userAgent,app=navigator.appVersion;return{//是否为iPhone或者QQHD浏览器iPhone:u.indexOf('iPhone')>-1,//是否iPadiPad:u.i...

1361
2015/5/4 16:35:42
0
View Details
原生javascript检测是否移动设备访问包括了45种

功能:原生javascript检测是否移动设备访问包括了45种代码如下:functioncheckMobile(){varpda_user_agent_list=newArray("2.0MMP","240320","AvantGo","BlackBerry","Blazer","Cellphone","Danger","DoCoMo","Elaine/3.0","...

1044
2015/4/28 14:00:18
0
View Details
原生javascript利用正则表达式获取url的参数值

功能:原生javascript利用正则表达式获取url的参数值function代码如下:functiongetParam(url,name){varsearch=document.location.search;varpattern=newRegExp("[?&]"+name+"\=([^&]+)","g");varmatcher=pattern.exec(url);var...

1848
2015/4/27 16:05:42
0
View Details
javascript面向对象编程术语

javascript面向对象编程术语Namespace命名空间允许开发人员在一个独特,应用相关的名字的名称下捆绑所有功能的容器。Class类定义对象的特征。它是对象的属性和方法的模板定义.Object对象类的一个实例。Property属性对象的特征,比如颜色。Method方法对象的能力,比如行走。Constructor构造函数对象初始化...

1232
2015/3/25 18:12:57
0
View Details
javascript获取网页位置属性详解

网页可见区域宽:document.body.clientWidth网页可见区域高:document.body.clientHeight网页可见区域宽:document.body.offsetWidth(包括边线的宽)网页可见区域高:document.body.offsetHeight(包括边线的宽)网页正文全文宽:document.body.scrollWidth网页正文全文高:documen...

1212
2015/1/22 14:11:27
0
View Details
网友czqn8分享javascript实现倒计时特效

window.onload=function(){functionlimit(){varendtime=newDate('2015/02/14,00:00:00'),nowtime=newDate(),theEnd=parseInt((endtime.getTime()-nowtime.getTime())/1000),t=document.getEleme...

1745
2014/12/16 22:12:58
0
View Details
javascript修改Cookie的属性expires

functionsetCookieExpires(CookieName,expires){varexp='';if(expires==''){exp='';//expires不设置,浏览器关闭时过期}else{exp=newDate();exp.setTime(exp.getTime()+expires);//增加日期exp=";expi...

2695
2014/12/8 17:42:34
0
View Details
获取客户端浏览器、系统、和驱动类型的javascript脚本

(function(){varbrowser='other',system='other',device='PC';varpf=navigator.platform,ua=navigator.userAgent,href=window.location.href;//埋点地址varroot='';//开关varON=false;//window系统匹...

1320
2014/12/8 17:38:21
0
View Details
javascript监听关闭浏览器页面的操作事件

window.onbeforeunload=function(){if(document.all){if(event.clientY<0){return"确定要离开吗?";}}else{return"确定要离开吗?";}}

6974
2014/11/25 10:14:20
0
View Details