這裏是我的HTML:螢火蟲給我的OnClick函數語法錯誤
<input type='checkbox' name='PatientReady1' value='Yes' checked onClick="PatientReady ("PatientReady1","111","PatientReady")">
而且我的javascript:
function PatientReady(element, TriageNo, Field){
debugger;
if (element.checked == 1){
new Ajax.Request (
"PatientReady.asp",
{
method: 'post',
parameters: {
TriageNo: TriageNo,
strReady: "Yes",
strElement: Field
},
asynchronous:false
}
);
}
else{
new Ajax.Request (
"PatientReady.asp",
{
method: 'post',
parameters: {
TriageNo: TriageNo,
strReady: "No",
strElement: Field
},
asynchronous:false
}
);
}
}
出於某種原因,我得到一個語法錯誤,當我點擊複選框時......我肯定我錯過了一些微不足道的東西,也許一組新的眼睛可以幫助你?
onclick =「PatientReady(」PatientReady1「,」111「,」PatientReady「)」 - 那些應該是函數調用中的單引號? – Mark 2009-09-01 18:52:50