易截截图软件、单文件、免安装、纯绿色、仅160KB

JavaScript代码(1)

//后台CS调用前台JS方法
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script>CheckInput()</script>");
//校验输入框是否为空,校验是否是数字
<script type="text/javascript" language="javascript">
         function CheckInput() {
             if (document.form1.txt_ReceiptID.value == "") {
                 alert('报销单号不能为空!');
                 document.form1.txt_ReceiptID.focus();
                 return false;
             }
             else {
                    if(checknumber(document.form1.txt_ReceiptID.value)
                    {
                        alert("报销单号为数字!");                       
                         document.form1.txt_ReceiptID.focus();
                         return false;
                 &nbs


相关文档:

常见firefox不支持的JavaScript问题

<a href="#" onclick="ChildNode(this);">aaa</a>要改为
<a href="#" onclick="ChildNode(event);">aaa</a>
无法取得this对象,要用以下方法来取得。
function ChildNode(e)
{
var evt = e ? e : (window.event ? window.event : null); //此方法为了在firefox中的兼容
var node = evt.srcEl ......

网页制作Javascript经典小技巧总结


网页制作Javascript经典小技巧总结
http://www.webjx.com  更新日期:2007-10-12 01:25  出处:网页教学网  作者:站长整理
每一项都是JS中的小技巧,但十分的实用!
1.document.write(”"); 输出语句
2.JS中的注释为//
3.传统的HTML文档顺序是:document->html->(head,body)
4.一个浏览� ......

简洁强大的JavaScript表单验证程序

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>vForm表单验证程 ......

javascript中loose type的影响


var obj = new Object();
obj.name = "hello";
obj['name'] = "world";
alert(obj.name);
被人问到这样一段代码,alert的结果应该是什么呢?
我回答:hello #结果大错特错!
应该是“world”!!!
因为js是一种松散类型的语言,obj虽然被声明是一个对象,但是把它当成数组来访问也没什么不可以。
虽然 ......

JavaScript的日期处理

var myDate = new Date();
myDate.getYear();        //获取当前年份(2位)
myDate.getFullYear();    //获取完整的年份(4位,1970-????)
myDate.getMonth();       //获取当前月份(0-11,0代表1月)
myDate.getDate();    ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号