我刚问了一个与此类似的问题但是有一个较小的例子。但是,该代码的问题与我当前的代码不同。 (如果你的好奇是我之前的问题:JavaScript Text not submitting form)
我正在处理我的第一个Web应用程序,我正在尝试使用javascript通过单击文本来提交表单。当我点击文本时没有任何反应。它现在应该只对一个简单的网页开放。我知道如何使用html处理表单,但是当我尝试使用javascript时没有任何反应。我正在使用unix,我已经配置了我的服务器和chmod 755 cgi文件。我不是服务器错误,因为我之前已经在它上面执行了cgi文件。
点击数字应该提交隐藏的表格并打开更详细的报告。我有一长串隐藏字段,因为我将数组传递给cgi文件。目前cgi文件只链接到一个简单的测试文件,因为当我点击链接时,cgi文件甚至没有运行。
这是html代码:
<html>
<head>
<title>Core Report</title>
<script language="JavaScript" type="text/javascript">
function getDetails (selectedField) <!--tell which list to print-->
{
document.details.resultsToPrint.value = selectedField;
document.details.submit();
}
</script>
<style>
#title {
text-align:center;
}
table {
margin-left:auto;
margin-right:auto;
text-align:center;
border: 2px solid black;
border-collapse: collapse;
width:30%;
}
.corner {background-color: red;} #Corner4{background-color: #7CFC00;}
</style>
</head>
<body>
<h1 id = 'title'>Core Report</h1>
<table>
<tbody>
<tr>
<th></th>
<th><font size='5'># of Passes</font></th>
<th><font size='5'># of Failures</font></th>
</tr><tr id = 'Corner1' class = 'corner'><td><font size='6'> Corner 1 </font></td><td><a href = 'javascript:getDetails(Corner1Passes)'><font size='6'> 201 </font></a></td><td><a href = 'javascript:getDetails(Corner1Failures)'><font size='6'> 18 </font></a></td></tr>
<tr id = 'Corner2' class = 'corner'><td><font size='6'> Corner 2 </font></td><td><a href = 'javascript:getDetails(Corner2Passes)'><font size='6'> 2 </font></a></td><td><a href = 'javascript:getDetails(Corner2Failures)'><font size='6'> 2 </font></a></td></tr>
<tr id = 'Corner3' class = 'corner'><td><font size='6'> Corner 3 </font></td><td><a href = 'javascript:getDetails(Corner3Passes)'><font size='6'> 2 </font></a></td><td><a href = 'javascript:getDetails(Corner3Failures)'><font size='6'> 2 </font></a></td></tr>
<tr id = 'Corner4' class = 'corner'><td><font size='6'> Corner 4 </font></td><td><a href = 'javascript:getDetails(Corner4Passes)'><font size='6'> 4 </font></a></td><td><a href = 'javascript:getDetails(Corner4Failures)'><font size='6'> 0 </font></a></td></tr>
</tbody></table>
<form name='details' method='post' action='/cgi-bin/hello.py'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/marginVoltage --margin high'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/verifyVoltage --margin high'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/1/testFanDirection'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/1/testFanPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/1/fan/testFanSpeed --station edvt'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/2/testFanDirection'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/2/testFanPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/2/fan/testFanSpeed --station edvt'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/3/testFanDirection'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/3/testFanPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/3/fan/testFanSpeed --station edvt'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/4/testFanDirection'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/4/testFanPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /fanChassis/4/fan/testFanSpeed --station edvt'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/testChecksums'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/testPmbusRevision'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/testPowerState --expectedState on'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/testPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/testRevision'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/testStatus'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/1/verifyModel'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/testChecksums'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/testPmbusRevision'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/testPowerState --expectedState on'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/testPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/testRevision'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/testStatus'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /powerSupplies/2/verifyModel'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testMaxOutputPower --maxOutputPower 320'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testPowerLoadSharing'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //verifyPsuFansCranked'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //verifyPsuFansCranked'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testACPowerSupplyOffStatus'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testPowerGood'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //verifyPsuFansCranked'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testACPowerSupplyOffStatus'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testPowerGood'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //verifyPsuFansCranked'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //verifyPsuFansCranked'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/testMicrocodeVersion'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/testTemperature'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/testPresence --pattern SFT00'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/testRegister --rail None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/mathFPTest --duration 30 --stopOnError True --verbose True'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/imcTest --duration 30 --verbose True --percentage 50'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/mathPrimeNumTest --duration 30 --stopOnError True --verbose True'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/testUSBDevices'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/sdram/testDDR --reset False --iterations 0 --duration 30 --blockSize 8000000 --memctl mc0'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpld/testScratchRegister'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpld/checkFanHealth'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpld/testRevision'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/usbFlash/testSize'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/sdram/checkeccTestmem --blockSize 16000000 --iterations 10000'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/sdram/0/spdseeprom/testMemory'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/sdram/0/spdseeprom/testPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/testDeviceId'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/testLoggedFaults'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/testStatus'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/testMarginAndReadVoltage'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/ucd/verifyVoltageStability --rail None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/tempsensor/testPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/tempsensor/testRegister'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/avxTest --verbose True'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/cpuLoadTest --duration 2 --core 8 --verbose True'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/mmxSseTest --verbose True'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/powerLoadTest --duration 60 --timeLow 1 --timeHigh 1'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/1/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/1/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/1/testIdentification --vendorId None --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/1/testPcieReadWrite --deviceVendorId 0 --resource None --useConfigSpace None --expectedValue 0 --register 0 --testType 0 --times 1000000'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/2/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/2/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/2/testIdentification --vendorId None --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/2/testPcieReadWrite --deviceVendorId 0 --resource None --useConfigSpace None --expectedValue 0 --register 0 --testType 0 --times 1000000'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/3/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/3/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/3/testIdentification --vendorId None --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/3/testPcieReadWrite --deviceVendorId 0 --resource None --useConfigSpace None --expectedValue 0 --register 0 --testType 0 --times 1000000'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/4/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/4/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/4/testIdentification --vendorId None --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/4/testPcieReadWrite --deviceVendorId 0 --resource None --useConfigSpace None --expectedValue 0 --register 0 --testType 0 --times 1000000'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/5/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/5/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/5/testIdentification --vendorId None --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/cpu/rootComplex/ports/5/testPcieReadWrite --deviceVendorId 0 --resource None --useConfigSpace None --expectedValue 0 --register 0 --testType 0 --times 1000000'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /cpuCard/fanLeds/testBasic'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testLoopbackPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: //testTempSensor'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/sol/testReadM2InfoAndSwVersion'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/testTemperature'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/testComponents'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/max6697/testPollTemperature'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/prefdl/testMemory'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/testDeviceId'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/testLoggedFaults'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/testPresence --pattern SFT002910'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/testRegister --rail None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/testRevision --revision SFT002910102'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/testStatus'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ucd/verifyVoltage --rail None --margin nominal'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir1/testDeviceId'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir1/testMarginAndReadVoltage'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir1/testPresence --mfgId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir1/testRegister'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir1/testVoltageMargining'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir1/verifyVoltage --rail None --margin nominal'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir2/testDeviceId'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir2/testMarginAndReadVoltage'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir2/testPresence --mfgId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir2/testRegister'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir3/testDeviceId'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir3/testMarginAndReadVoltage'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir3/testPresence --mfgId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir3/testRegister'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir3/testVoltageMargining'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/ir3/verifyVoltage --rail None --margin nominal'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/0/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/0/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/0/testClearErrors'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/0/testIdentification --vendorId 4277 --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/0/testPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/1/testAudit'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/1/testAuditPath'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/1/testClearErrors'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/1/testIdentification --vendorId 4277 --deviceId None'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/pcieSwitch/ports/1/testPresence'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/1/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/1/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/2/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/2/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/3/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/3/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/4/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/4/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/5/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/5/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/6/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/6/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/7/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/7/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/8/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/8/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/9/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/9/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/10/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/10/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/11/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/11/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/12/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/12/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/13/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/13/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/14/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/14/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/15/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/15/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/16/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/16/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/17/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/17/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/18/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/18/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/19/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/19/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/20/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/20/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/21/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/21/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/22/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/22/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/23/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/23/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/24/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/24/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/25/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/25/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/26/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/26/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/27/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/27/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/28/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/28/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/29/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/29/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/30/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/30/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/31/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/31/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/32/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/32/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/33/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/33/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/34/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/34/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/35/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/35/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/36/testAll'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/xcvrs/36/testLowSpeedSignals'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/portsLeds/testBasic'>
<input type= 'hidden' name='Corner1Passes' value='TEST PASS: /switchCard/boardLeds/testBasic'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/verifyVoltage --margin high'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /cpuCard/sdram/memVerify --ddrTypeExp DDR3 --memSizeMBExp 4096 --dimmsExp 1 --spdAddrsExp [[81]] --ignorecompare False --verbose False'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: //testVoltageMargining'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/sol/testAuthM --kgfile None'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/0/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/1/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/2/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/3/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/4/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/5/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/6/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/pcieSwitch/lanes/7/testLoopback'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/xcvrs/1/testTunableLaser'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/xcvrs/2/testTunableLaser'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/xcvrs/3/testTunableLaser'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/xcvrs/4/testTunableLaser'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/idproms/1/testMemory'>
<input type= 'hidden' name='Corner1Failures' value='TEST FAIL: /switchCard/idproms/2/testMemory'>
<input type= 'hidden' name='Corner2Passes' value='TEST PASS hello'>
<input type= 'hidden' name='Corner2Passes' value='TEST PASS world'>
<input type= 'hidden' name='Corner2Failures' value='TEST FAIL hello'>
<input type= 'hidden' name='Corner2Failures' value='TEST FAIL world'>
<input type= 'hidden' name='Corner3Passes' value='TEST PASS howdy'>
<input type= 'hidden' name='Corner3Passes' value='TEST PASS world'>
<input type= 'hidden' name='Corner3Failures' value='TEST FAIL howdy'>
<input type= 'hidden' name='Corner3Failures' value='TEST FAIL world'>
<input type= 'hidden' name='Corner4Passes' value='TEST PASS I'>
<input type= 'hidden' name='Corner4Passes' value='TEST PASS am'>
<input type= 'hidden' name='Corner4Passes' value='TEST PASS William'>
<input type= 'hidden' name='Corner4Passes' value='TEST PASS Song'>
<input type = 'hidden' name = 'resultsToPrint' >
</form>
</body></html>
这是测试cgi文件:
#!/usr/bin/python
import cgitb, cgi
cgitb.enable()
print "Content-type:text/html\r\n\r\n"
print '<html>'
print '<head>'
print '<title>Hello Word - First CGI Program</title>'
print '</head>'
print '<body>'
print '<h2>Hello Word! This is my first CGI program</h2>'
print '</body>'
print '</html>'
我一直想弄清楚几个小时的错误。我是javascript的初学者,所以任何帮助都将非常感谢!
答案 0 :(得分:2)
当您在JavaScript中传递一个字符串值时,您需要正确引用它,否则JavaScript会认为您的意思是具有该名称的变量。
e.g。
<a href = 'javascript:getDetails(Corner2Passes)'><font size='6'> 2 </font></a>
应该是:
<a href="javascript:getDetails('Corner2Passes');"><font size='6'> 2 </font></a>
一些非必要的注意事项:
=
字符周围不需要空格<font>
代码在几年前已被弃用,我建议您使用<span>
代码,虽然您可以通过样式属性设置字体大小,但如果添加class
代码1}}属性您可以使用一个声明<!doctype html>
标记之前添加<html>
标记,以确保您的网页以标准模式呈现(非常痛苦,特别是在较旧的IE版本中,如果您没有&#39;吨)<script>
标记中的lang或type属性,默认情况下它被视为JavaScript