<html> <head> <title>初始化单选</title> <script> function initradio(rName,rValue){ var rObj = document.getElementsByName(rName); for(var i = 0;i < rObj.length;i++){ if(rObj[i].value == rValue){ rObj[i].che... Read More
posted @ 2012-10-26 14:31 vincent_ds Views(23138) Comments(0) Diggs(0) Edit
开发者最容易犯的JavaScript错误,总结出13个。这些当中可能少不了你犯的错误^_^。我们描述了这些陋习,并列出来解决办法,希望对开发者有帮助。1.for.. 数组迭代的用法 Usage of for..in to iterate Arrays举例:var myArray = [ “a”, “b”, “c” ];var totalElements = myArray.length;for (var i = 0; i < totalElements; i++) { console.log(myArray[i]);}这里主要的问题是语句中的“for..."不能保证顺序,这意味 Read More
posted @ 2012-10-26 10:00 vincent_ds Views(216) Comments(0) Diggs(0) Edit
<input type="text" name="sn1" maxlength="4" id="sn1"/> - <input type="text" name="sn2" maxlength="4" id="sn2"/> - <input type="text" name="sn3" maxlength="4" id="sn3" Read More
posted @ 2012-10-25 21:36 vincent_ds Views(6846) Comments(1) Diggs(0) Edit
想必大家都听说说PHPnow这个绿色 PHP 环境包吧,本地搭建PHP环境是非常的方便。 但是时不时电脑难免出问题,这个软件亦是如此,当你稍不注意重新安装或者删除(卸载)不完全决定重新安装时便会出现下面的杯具!___________________________________________________| 正在安装 Apache … || 安装服务 [ Apache_pn ] 失败. 可能原因如下: || 1. 服务名已存在, 请卸载或使用不同的服务名. || 2. 非管理员权限, 不能操作 Windows NT 服务. ||______________________________ Read More
posted @ 2012-10-20 03:18 vincent_ds Views(540) Comments(1) Diggs(0) Edit
1. 只能是数字:如果是想用正则表达式的话,可以用下面的写法var patten=new RegExp(/^[0-9]+$/);if(!patten.test(form1.type_zhi.value)) { alert("栏目参数只准是数字!"); form1.type_zhi.focus(); return false; } 如果不想用正则表达式的话,可以用 isNaN()方法,isNaN 意思是is Not a Number。即是不是不能转换为一个数字。if(isNaN(form1.type_zhi.value)){ alert("栏目参数只准是数字!&qu Read More
posted @ 2012-10-18 17:40 vincent_ds Views(178) Comments(0) Diggs(0) Edit
byzhangxinxufromhttp://www.zhangxinxu.com本文地址:http://www.zhangxinxu.com/wordpress/?p=471一、匆匆带过的概念关于CSS中层级z-index的定义啊什么的不是本文的重点,不会花费过多篇幅详细讲述。这里就简单带过,z-index伴随着层的概念产生的。网页中,层的概念与photoshop或是flash中层的概念是一致的。熟悉photoshop或是flash的应该知道,层级越高(图层越靠上),越在上面显示,如果层发生重叠,层级高的会覆盖层级低的,如果非透明或半透明,则会遮挡。在photoshop中,层的高低就是靠手动 Read More
posted @ 2012-10-16 16:10 vincent_ds Views(140) Comments(0) Diggs(0) Edit
做web开发的朋友都清楚,js程序的调试是相当郁闷的,因为首先这种语言语法比较灵活,它是一种弱类型的脚本语言,很多错误是无法控制的,这些不谈, 最痛苦的是没有什么好的调试工具,现在的情况比以前稍好,在Firefox下还有firebug,这的确是一个不错的js调试工具,但在IE下使用就很麻 烦,而且效果很不好,鄙人一直苦于寻找一个很好的IE下的js调试工具,能够自动捕获错误,并定位位置和原因,没想到今天竟在无意中寻找到了这么个好工 具,不敢私藏,共享出来,希望能为各位web开发者带来方便这个工具的名字叫Companion.JS, 请注意,这可不是一个js文件,而是一个名字,它是作为ie的插件来安 Read More
posted @ 2012-10-16 14:58 vincent_ds Views(193) Comments(0) Diggs(0) Edit
JS作用域为“函数级作用域”,记住最简明的一句“函数中声明的所有变量,无论是在哪里声明的,在整个函数中它们都是有定义的。”下面是自己的笔记(1)首先,只是在这个函数中有定义,也就是说,在输出语句后定义和输出语句前定义是一样的结果,最后变量的值都是“undefined”,下面两种写法结果一样;functionlocal(){document.write(local);varlocal;}functionlocal(){varlocal;document.write(local);}如果涉及到变量赋值,下面两个效果就不一样functionlocal_1(){varlocal="local Read More
posted @ 2012-10-12 15:53 vincent_ds Views(224) Comments(0) Diggs(0) Edit
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>基于JQuery1.4 Tab选项卡 一行代码轻松搞定</title><style> .active{color:#F00}</style><script src="http://www.google.com/jsapi"></script><scr Read More
posted @ 2012-10-09 17:57 vincent_ds Views(201) Comments(0) Diggs(0) Edit
chrome不能打印在css里用background写的背景图需要给图片的css加一句:-webkit-print-color-adjust:exact; Read More
posted @ 2012-10-09 10:18 vincent_ds Views(1073) Comments(0) Diggs(0) Edit