我加载了一个内部页面,我在IE中开发,并在底部显示一些JS错误: 它说行107字符6.我看看JScript文件,它有这样的代码:JS错误:对象预计
function isLessThanStartDate(obj)
{
var startdate = new Date(document.getElementById('txtSD').value);
var enddate = new Date(obj.value);
var weekending = new Date(document.getElementById('txtWE').value);
if (!(isDate(startdate)))
{
obj.style.backgroundColor="red";
alert (obj.value + " is not a valid date!");
obj.value="";
return;
}
if (enddate < startdate)
{
obj.style.backgroundColor="red";
alert ("End date: " + enddate + " cannot be less then start date: " + startdate);
obj.value="";
}
else if (enddate > weekending)
{
obj.style.backgroundColor="red";
alert ("End date: " + enddate + " cannot be greater then week ending date: " + weekending);
obj.value="";
}
else
{
obj.style.backgroundColor="";
}
}
线107是在那里说
var weekending = new Date(document.getElementById('txtWE').value);
这是为什么抱怨行?我没有看到有什么不对...
我不相信错误报告使用短语“一些JS错误”。它实际上说了什么? – Quentin 2011-05-17 15:49:42
如果它是IE浏览器,它不会比这更好... – Rudie 2011-05-17 15:51:08
@David Dorward - @Rudie是正确的,它不显示其他许多..我尝试使用萤火虫,但它不给我任何信息(因为我不知道如何使用它)。它说:用户代理:Mozilla/4.0(兼容; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E; .NET CLR 1.1.4322)时间戳:2011年5月17日星期二15:52:00 UTC消息:Object required行:150字符:5代码:0 URI :http://localhost/blah/include/JScript.js消息:需要的对象行:107字符:6代码:0 – oJM86o 2011-05-17 15:52:28