用JavaScript来实现一些简单的控件验证
页面一:
<html>
<head>
<title> 验证与提交一 </title>
<script>
function focusSelect(ID) //当验证不能通过时获得验证控件的焦点和内容
{
document.getElementById(ID).focus();
document.getElementById(ID).select();
}
function txtNameOnBlur() //对用户名的所有验证
{
var txt=document.getElementById("txtName").value;
if(txt=="")
{
document.getElementById("fName").innerHTML="*";
//focusSelect('txtName');
return false;
}else
{
if(isNaN(txt))
{
document.getElementById("fName").innerHTML="用户名必须是数字!";
//focusSelect('txtName');
return false;
}else
if(txt.length!=10)
{
document.getElementById("fName").innerHTML="用户名必须是10位";
//focusSelect('txtName');
return false;
}else
if(txt.substr(txt.length-3,txt.length+1) != "321")
{
document.getElementById("fName").innerHTML="用户名后3位必须是321!";
//focusSelect('txtName');
return false;
}
}
return true;
}
相关文档:
This document is for establishing build standard for JavaScript and CSS compression
The objective for this document is to establish a companywide JavaScript and CSS compression standard that can be shared crossing multiple SharePoint product development projects. This is the first draft
Overview ......
<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
......
javascript内存泄露的问题一直以来都不受到大家的重视,原因是对用户的影响没有太实际的表现,或许近几年内存发展迅速。脚本内存再泄露也不会有太大影响。
当然作为前端开发的同学们,就不能有这样的侥幸心理。出现memory leaks很大程度上是因为程序的不成熟和编码不太规范造成的。不过,这里就不说如何出现问题的,对问 ......
http://css-tricks.com/creating-a-slick-auto-playing-featured-content-slider/
demo:http://css-tricks.com/examples/FeaturedContentSlider/
Featured Content Slider Using jQuery
http://demo.webdeveloperplus.com/featured-content-slider/ ......
navigator对象主要用于检测浏览器的版本,该对象的属性主要有:
appcodeName:
appVersion
.....
JavaScript中保留字。。。
转换函数eval("12.34*12")
parseInt()
parseFloat();
join() 把一个数组的所有元素都转换成字符串
reverse()颠倒数组
sort排序
concat()
slice()
splice()
push()
pop()
toString() ......