第二警报不起作用

| 我有这个函数,它从文档id调用值,并定义了一些变量。 隐藏已经定义的变量并且不出现第二个警告框,这一切似乎都可以正常工作,你知道为什么吗?
function Calculate() {
var ContentMinutes = document.getElementById (\"ContentMinutes\").value;
var NoOfFrames = 5;
var EstimatedCoreHours = document.getElementById (\"EstimatedCoreHours\").value;
var ServiceLevel=document.getElementById(\'SerivceLevelDD\').options[document.getElementById(\'SerivceLevelDD\')    .selectedIndex].value
var RenderHours = 1;
var CoresInTest = 2;

var EstimatedTotal =  GetNumeric(ServiceLevel) * GetNumeric(EstimatedCoreHours);
alert(\'hi = \'+EstimatedTotal.toFixed(2));

var EstimatedCoreHours =  GetNumeric(NoOfFrames) * GetNumeric(RenderHours) * GetNumeric(CoresInTest);
alert(\' = \'+EstimatedCoreHoursTotal.toFixed(2));
}

function GetNumeric(val) {

if (isNaN(parseFloat(val))) {
return 0;
}
return parseFloat(val);
}
对不起,我忘了注册... 我注释掉了\'var EstimatedCoreHours = document.getElementById(\“ EstimatedCoreHours \”)。value; \'变量,因为它不是必需的,但仍然无法正常工作...     
已邀请:
你有
EstimatedCoreHours = 
但您提醒:
EstimatedCoreHoursTotal
因此,我猜您想更改:
var EstimatedCoreHours =  GetNumeric(NoOfFrames) * GetNumeric(RenderHours) * GetNumeric(CoresInTest);
至:
var EstimatedCoreHoursTotal =  GetNumeric(NoOfFrames) * GetNumeric(RenderHours) * GetNumeric(CoresInTest);
    

要回复问题请先登录注册