한영확인하기 > script

본문 바로가기
사이트 내 전체검색

script

한영확인하기

페이지 정보

작성자 서방님 댓글 0건 조회 130회 작성일 07-08-10 09:25

본문

<script language="javascript">
<!--
function engCheck(str)
{
    for (i = 0; i < str.length; i++) {
        ch = escape(str.charAt(i));        //ISO-Latin-1 문자셋으로 변경
        if (strCharByte(ch) == 2) {
                return false; // 한글
        }
    }
    return true;  // 영어
}

function strCharByte(chStr)
{
        if (chStr.substring(0, 2) == '%u') {
                if (chStr.substring(2,4) == '00')
                        return 1;
                else
                        return 2;        //한글
        }
        else if (chStr.substring(0,1) == '%') {
                if (parseInt(chStr.substring(1,3), 16) > 127)
                        return 2;        //한글
                else
                        return 1;
        }
        else {
                return 1;
        }
}

//-->
</script>

<input type="text" name="str" OnBlur="engCheck(this.value);">

댓글목록

등록된 댓글이 없습니다.

Total 846건 33 페이지
게시물 검색

회원로그인

접속자집계

오늘
267
어제
617
최대
1,347
전체
173,415
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.