這是我不知道的那些日子之一:我是否會失去主意?如果我通過這個簡單的JavaScript函數步驟,從3行的執行跳到第7行爲什麼JavaScript跳過我的功能?
function editStudy() {
var studyindex = document.StudyMaint.StudyList.selectedIndex;
var studyabrv = document.StudyMaint.StudyList[index].text; //Line 3
var msg="Edit study "+studyabrv+"?";
// Get the Study record id was selected in the picklist,
// then go to Study edit screen, then
if (confirm(msg)) {
location.href="editStudy.php?action=UPDATE&studyindex="+studyindex+"&studyabrv="+studyabrv;
} //Line 7
}
但我的形式StudyMaint定義:
<body>
<?php showUserLine(); ?>
<form name="StudyMaint" action="Process_StudyMaint.php" method="POST" onsubmit="return false">
<div id="dataentrybox">
<div id="innerbox">
<div align="center">
...
有誰看到我在做什麼錯在這裏?
你在哪裏調用函數? – j08691 2013-03-25 21:12:55
第3行和第7行是什麼? – Blender 2013-03-25 21:13:07
中間有四行空白/評論? – Bergi 2013-03-25 21:13:07