帮忙看看这个判断日期的函数有什么问题?为什么好像没执行到? 如果一个按钮定义了两个onclick 的函数,是否能够两个都执行? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Date.parse必须用月/日/年的格式来表示,例如"7/20/96";d1 = Date.parse(d.replace(("-","/")); // 转换为日期对象 <---写错了,括号多了,我再看看。 Date.parse不是转换时间的函数嘛。d.replace也不能这么用,你想实现一个什么功能噢? function CheckDate(Obj){ datestring=Obj; execScript("mmyy=isdate(datestring)","vbscript"); if (mmyy) { execScript("ss_sub=datediff('s',now(),cdate(datestring))","vbscript") if (ss_sub>0) { alert("居然现在都还没到这个时刻!写特"); return false; } } else { alert ("日期格式不对"); return false; } return true;} execScript("vbscript语句","vbscript")上面的datestring=Obj; 改成datestring=Obj.value; 就OK了我试过用JS比较输入的日期与当前日期,但只在月-日-年格式下通过,如果输入值为年-月-日,Date.parse(d1)的值就会为空,无法比较的了。。if (mmyy) { d1=new Date();d1=datestring;d2=new Date();//alert(Date.parse(d1)+"mm"+Date.parse(d2));if (Date.parse(d1)>Date.parse(d2)) { alert("居然现在都还没到这个时刻!"); return false; } javascript传参问题,能不能解? 浏览本机网页时每个页面都被挂代码,是什么原理 javascript基础差,请帮看一下下面的代码那里有问题。 js提交多个表单 怎样用javascript中弹出一个文件选择的对话框? radio 的问题 关于原型和this 怎样用JAVASCRIPT脚本实现在WEB页面中不用刷新网页就能获得系统当前时间的程序? 为什么具有编辑功能的iframe的获取的值一闪而过,不能固定呢??(关于html编辑器) 高手帮我看看一个未解决的问题。 如何控制小数位数? 如何判断一个字符串是否为空或者是否只由空格组成/?
d1 = Date.parse(d.replace(("-","/")); // 转换为日期对象 <---写错了,括号多了,
我再看看。
d.replace也不能这么用,你想实现
一个什么功能噢?
{
datestring=Obj;
execScript("mmyy=isdate(datestring)","vbscript");
if (mmyy)
{
execScript("ss_sub=datediff('s',now(),cdate(datestring))","vbscript")
if (ss_sub>0)
{
alert("居然现在都还没到这个时刻!写特");
return false;
}
}
else
{
alert ("日期格式不对");
return false;
}
return true;
}
我试过用JS比较输入的日期与当前日期,但只在月-日-年格式下通过,如果输入值为年-月-日,Date.parse(d1)的值就会为空,无法比较的了。。
if (mmyy)
{
d1=new Date();
d1=datestring;
d2=new Date();
//alert(Date.parse(d1)+"mm"+Date.parse(d2));
if (Date.parse(d1)>Date.parse(d2))
{
alert("居然现在都还没到这个时刻!");
return false;
}