스크립트 오류 해결좀 부탁드립니다.. 정보
JavaScript 스크립트 오류 해결좀 부탁드립니다..본문
웹 페이지 오류 세부 정보
사용자 에이전트: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; BTRS131060; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)
타임스탬프: Thu, 8 Mar 2012 14:23:53 UTC
타임스탬프: Thu, 8 Mar 2012 14:23:53 UTC
메시지: 'document.getElementById(...)'은(는) null 이거나 개체가 아닙니다.
줄: 54
문자: 9
코드: 0
URI: http://moohan2.cafe24.com/
위처럼 오류가 나네요. 사이트 메인에 그래서 해당부분 head.php 부분을 보니깐
<script>
function search_submit(f) {
f.stx.value = f.search_str.value;
f.action = '../bbs/search.php';
}
document.getElementById('search_flag').value = '상품';
</script>
function search_submit(f) {
f.stx.value = f.search_str.value;
f.action = '../bbs/search.php';
}
document.getElementById('search_flag').value = '상품';
</script>
이렇게 있길래 지우거나 수정하면 head,sub.php 에서
header("Content-Type: text/html; charset=$g4[charset]");
$gmnow = gmdate("D, d M Y H:i:s") . " GMT";
header("Expires: 0"); // rfc2616 - Section 14.21
header("Last-Modified: " . $gmnow);
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: pre-check=0, post-check=0, max-age=0"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
$gmnow = gmdate("D, d M Y H:i:s") . " GMT";
header("Expires: 0"); // rfc2616 - Section 14.21
header("Last-Modified: " . $gmnow);
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: pre-check=0, post-check=0, max-age=0"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
이부분이 화면에 값이 포함안되었다고 뜨네요.. 어떻게 하나요..해결좀 부탁드립니다..ㅠㅠ 며칠째 고생하네요..
추천
0
0
댓글 4개

메시지: 'document.getElementById(...)'은(는) null 이거나 개체가 아닙니다.
라는 경우
getElementById로 참조하시는 시점에 그 아이디의 태그가 참조가능한지요?
위
<script>
function search_submit(f) {
f.stx.value = f.search_str.value;
f.action = '../bbs/search.php';
}
document.getElementById('search_flag').value = '상품';
</script>
를 코드의 아래로 넣어보시고 이상없다면 순서의 문제입니다.
라는 경우
getElementById로 참조하시는 시점에 그 아이디의 태그가 참조가능한지요?
위
<script>
function search_submit(f) {
f.stx.value = f.search_str.value;
f.action = '../bbs/search.php';
}
document.getElementById('search_flag').value = '상품';
</script>
를 코드의 아래로 넣어보시고 이상없다면 순서의 문제입니다.
...
어렵네요ㅠㅠ
윗분을 설명대로 가자면
$(document).ready(function(){
document.getElementById('search_flag').value = '상품';
});
$(document).ready(function(){
document.getElementById('search_flag').value = '상품';
});