我在脚本中用了一段javascript,一运行就告诉我"缺少对象" 错误,指向下面第五行
<SCRIPT language="javascript">
var chk_result;
function submit_item() {
var item_form = document.forms['itemform'];
var itemdesc_form = document.forms['formHtmlEdit'];
chk_result = 1;
checkfield();
if (chk_result == 1){
item_form.action = '';
item_form.target = '_self';
getEditData();
item_form.pDesc.value = itemdesc_form.editor_editcontent.value;
item_form.submit();
}
}
</SCRIPT>
參考答案:checkfield(); 是否在这个function submit_item() 的前面?itemdesc_form.editor_editcontent.value; 呢?
等等.
JAVASCRIPT是从上到下执行的,如果前面没有这些东西,就有可能缺少对像的.