随笔分类 -  JAVASCRIPT

摘要:这段文档标记很重要 网页可见区域宽:document.body.clientWidth (不加文档标记的情况下) 网页可见区域宽:document.documentElement.clientWidth(加文档标记的情况下) 网页可见区域高:document.body.clientHeight网页可见区域宽:document.body.offsetWidth (包括边线的宽)网页可见区域高:document.body.offsetHeight (包括边线的宽)网页正文全文宽:document.body.scrollWidth网页正文全文高:document.body.scroll... 阅读全文
posted @ 2013-08-23 13:59 alaricblog 阅读(168) 评论(0) 推荐(0)
摘要:if(confirm("确定该申诉通过审核吗?")){ ////doSomething...... } 阅读全文
posted @ 2013-08-23 13:59 alaricblog 阅读(183) 评论(0) 推荐(0)
摘要:setInterval动作的作用是在播放动画的时,每隔一定时间就调用函数,方法或对象。可以使用本动作更新来自数据库的变量或更新时间显示。setInterval动作的语法格式如下:setInterval(function,interval[,arg1,arg2,......argn])setInterval(object,methodName,interval[,arg1,arg2,.....argn])第一种格式是标准动作面板中setInterval函数的默认语法,第二种格式是在专家模式动作中使用的方法。其中的参数function是一个函数名或者一个对匿名函数的引用。object参数指定从Ob 阅读全文
posted @ 2013-08-23 13:58 alaricblog 阅读(148) 评论(0) 推荐(0)
摘要:/**去空格*/ function LTrim(str) { for(var i=0; str.charAt(i)==" "; i++); return str.substring(i,str.length); } function RTrim(str){ for (var i=str.length-1; str.charAt(i)==" "; i--); return str.substring(0,i+1); } function Trim(str) { return LTrim(RTrim(str)); } 阅读全文
posted @ 2013-08-23 13:58 alaricblog 阅读(103) 评论(0) 推荐(0)
摘要:Math.floor(27/10); //返回值为小于等于其数值参数的最大整数值。 2Math.ceil(27/10); //返回值为大于等于其数字参数的最小整数。 3 阅读全文
posted @ 2013-08-23 13:58 alaricblog 阅读(298) 评论(0) 推荐(0)
摘要:New Document 阅读全文
posted @ 2013-08-23 13:58 alaricblog 阅读(233) 评论(0) 推荐(0)
摘要:New Document 阅读全文
posted @ 2013-08-23 13:58 alaricblog 阅读(220) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2013-08-23 13:57 alaricblog 阅读(154) 评论(0) 推荐(0)
摘要:一.Javascript 的正则表达式的建造有两种方法:1. 第一种:直接用/*****/表示,如: var myReg1 = /^[\w]+$/;var b = myReg1.test("ddd");2. 第二种:用RegExp对象,如: var myReg = new RegExp("^[\\w]+$"); var a = myReg.test("dddd");二.javaScript 的正则表达式匹配也有两种方法:1. 用test()函数;如: var myReg = new RegExp("^[\\w]+$" 阅读全文
posted @ 2013-08-23 13:57 alaricblog 阅读(94) 评论(0) 推荐(0)
摘要:正则表达式(regular expression)对象包含一个正则表达式模式(pattern)。它具有用正则表达式模式去匹配或代替一个串(string)中特定字符(或字符集合)的属性(properties)和方法(methods)。 要为一个单独的正则表达式添加属性,可以使用正则表达式构造函数(constructor function),无论何时被调用的预设置的正则表达式拥有静态的属性(the predefined RegExp object has static properties that are set whenever any regular expression is used, 阅读全文
posted @ 2013-08-23 13:57 alaricblog 阅读(102) 评论(0) 推荐(0)
摘要:本文来自javaeye。。。。//返回该登陆页面,并予以错误提示信息 response.setContentType("application/xml"); //application/xml代表的是XML形式返回 response.setHeader("Cache-Control", "no-cache"); //设置不缓存 //组织返回数据 String xml=""; xml+=""; xml+=""; xml+="name0120"; xml+=& 阅读全文
posted @ 2013-08-23 13:55 alaricblog 阅读(167) 评论(0) 推荐(0)
摘要:function getXMLHttpRequest(){ //IE浏览器 var client = getXMLHttpRequestFromIE(); if(client == null){ //非IE浏览器 client = new XMLHttpRequest(); } return client;}function getXMLHttpRequestFromIE(){ var namePrefixes = ["Msxml3", "Msxml2", "Msxml", "Microsoft"]; for(va 阅读全文
posted @ 2013-08-23 13:55 alaricblog 阅读(176) 评论(0) 推荐(0)
摘要:1.鼠标经过自动选择文本: Onmouseover=”this.focus()” Onfocus=”this.select()”2.对单选按钮的设置 Function getChice(){ Var oform = document.froms[myForm1]; Var aChoices = oform.camera; For(var i=1;i Function changeBoxes(action){ Var oform = document.forms[myForm1]; Var ocheckBox = oform.hobby; For(var i=1;i个数2 selected... 阅读全文
posted @ 2013-08-23 13:55 alaricblog 阅读(150) 评论(0) 推荐(0)
摘要:文档对象模型(Document Object Module)定义了用户操作文档对象的接口。 阅读全文
posted @ 2013-08-23 13:55 alaricblog 阅读(66) 评论(0) 推荐(0)