uncaught typeerror
본문
위의 그림같이 에러가 발생하는데 에러 발생원인이 자바스크립가 먼저 실행되서 발생한다고 하는데 어떻게 수정을 해야할지 감이 잡히지 않아 질문올립니다ㅠㅠ
바쁘신 시간내어주셔서 항상 감사드립니다!
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
?>
<section id="bo_w">
<h2 class="sound_only"><?php echo $g5['title'] ?></h2>
<!-- 게시물 작성/수정 시작 { -->
<form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off" style="width:<?php echo $width; ?>">
<input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">
<input type="hidden" name="w" value="<?php echo $w ?>">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<?php
$option = '';
$option_hidden = '';
if ($is_notice || $is_html || $is_secret || $is_mail) {
$option = '';
if ($is_notice) {
$option .= PHP_EOL.'<li class="chk_box"><input type="checkbox" id="notice" name="notice" class="selec_chk" value="1" '.$notice_checked.'>'.PHP_EOL.'<label for="notice"><span></span>공지</label></li>';
}
if ($is_html) {
if ($is_dhtml_editor) {
$option_hidden .= '<input type="hidden" value="html1" name="html">';
} else {
$option .= PHP_EOL.'<li class="chk_box"><input type="checkbox" id="html" name="html" onclick="html_auto_br(this);" class="selec_chk" value="'.$html_value.'" '.$html_checked.'>'.PHP_EOL.'<label for="html"><span></span>html</label></li>';
}
}
if ($is_secret) {
if ($is_admin || $is_secret==1) {
$option .= PHP_EOL.'<li class="chk_box"><input type="checkbox" id="secret" name="secret" class="selec_chk" value="secret" '.$secret_checked.'>'.PHP_EOL.'<label for="secret"><span></span>비밀글</label></li>';
} else {
$option_hidden .= '<input type="hidden" name="secret" value="secret">';
}
}
if ($is_mail) {
$option .= PHP_EOL.'<li class="chk_box"><input type="checkbox" id="mail" name="mail" class="selec_chk" value="mail" '.$recv_email_checked.'>'.PHP_EOL.'<label for="mail"><span></span>답변메일받기</label></li>';
}
}
echo $option_hidden;
?>
<?php if ($is_category) { ?>
<div class="bo_w_select write_div">
<label for="ca_name" class="sound_only">분류<strong>필수</strong></label>
<select name="ca_name" id="ca_name" required>
<option value="">분류를 선택하세요</option>
<?php echo $category_option ?>
</select>
</div>
<?php } ?>
<div class="bo_w_info write_div">
<?php if ($is_name) { ?>
<label for="wr_name" class="sound_only">이름<strong>필수</strong></label>
<input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input half_input required" placeholder="이름">
<?php } ?>
<?php if ($is_password) { ?>
<label for="wr_password" class="sound_only">비밀번호<strong>필수</strong></label>
<input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?> class="frm_input half_input <?php echo $password_required ?>" placeholder="비밀번호">
<?php } ?>
<?php if ($is_email) { ?>
<label for="wr_email" class="sound_only">이메일</label>
<input type="text" name="wr_email" value="<?php echo $email ?>" id="wr_email" class="frm_input half_input email " placeholder="이메일">
<?php } ?>
<?php if ($is_homepage) { ?>
<label for="wr_homepage" class="sound_only">홈페이지</label>
<input type="text" name="wr_homepage" value="<?php echo $homepage ?>" id="wr_homepage" class="frm_input half_input" size="50" placeholder="홈페이지">
<?php } ?>
</div>
<div class="write_div">
<label>질병코드</label>
<input id="diseaseCode" name="wr_subject" type="text">
<label>질병명(한글)</label>
<input id="diseaseNameKR" name="wr_content" type="text">
<label>질병명(영문)</label>
<input id="diseaseNameEN" type="text">
</div>
<div class="btn_confirm write_div">
<a href="<?php echo get_pretty_url($bo_table); ?>" class="btn_cancel btn">취소</a>
<button type="submit" id="btn_submit" onclick="saveDiseaseCode()" accesskey="s" class="btn_submit btn">작성완료</button>
</div>
</form>
<script>
function saveDiseaseCode() {
$.ajax({
url : " http://localhost/bbs/dataloader/data_save_fish.php",
type : "post",
data : {
type : "saveDiseaseCode",
diseaseCode : $('#diseaseCode').val(),
diseaseNameKR : $('#diseaseNameKR').val(),
diseaseNameEN : $('#diseaseNameEN').val()
},
success : function() {
alert("SUCCESS!")
},
error : function(err){
alert(err)
}
});
};
<?php if($write_min || $write_max) { ?>
// 글자수 제한
var char_min = parseInt(<?php echo $write_min; ?>); // 최소
var char_max = parseInt(<?php echo $write_max; ?>); // 최대
check_byte("wr_content", "char_count");
$(function() {
$("#wr_content").on("keyup", function() {
check_byte("wr_content", "char_count");
});
});
<?php } ?>
function html_auto_br(obj)
{
if (obj.checked) {
result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
if (result)
obj.value = "html2";
else
obj.value = "html1";
}
else
obj.value = "";
}
function fwrite_submit(f)
{
<?php echo $editor_js; // 에디터 사용시 자바스크립트에서 내용을 폼필드로 넣어주며 내용이 입력되었는지 검사함 ?>
var subject = "";
var content = "";
$.ajax({
url: g5_bbs_url+"/ajax.filter.php",
type: "POST",
data: {
"subject": f.wr_subject.value,
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (subject) {
alert("제목에 금지단어('"+subject+"')가 포함되어있습니다");
f.wr_subject.focus();
return false;
}
if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
if (typeof(ed_wr_content) != "undefined")
ed_wr_content.returnFalse();
else
f.wr_content.focus();
return false;
}
if (document.getElementById("char_count")) {
if (char_min > 0 || char_max > 0) {
var cnt = parseInt(check_byte("wr_content", "char_count"));
if (char_min > 0 && char_min > cnt) {
alert("내용은 "+char_min+"글자 이상 쓰셔야 합니다.");
return false;
}
else if (char_max > 0 && char_max < cnt) {
alert("내용은 "+char_max+"글자 이하로 쓰셔야 합니다.");
return false;
}
}
}
<?php echo $captcha_js; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
document.getElementById("btn_submit").disabled = "disabled";
return true;
}
</script>
</section>
<!-- } 게시물 작성/수정 끝 -->
답변 1
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> 상단에 안보이네요.
답변을 작성하시기 전에 로그인 해주세요.