• 회원가입
  • 로그인
  • 구글아이디로 로그인

[AJAX] JS - AJAX - ASP 아작스 예제 (= 입력제시어 = 입력예제)

PHP와 작동 메커니즘 동일

https://homzzang.com/b/js-84

 


b.asp

<p>제시어: <span id="txtHint"></span></p> 


<p>입력: <input type="text" id="txt1" onkeyup="hz(this.value)"></p>


<script>

function hz(str) {

  var xhttp;

  if (str.length == 0) { 

    document.getElementById("txtHint").innerHTML = "";

    return;

  }

  xhttp = new XMLHttpRequest();

  xhttp.onreadystatechange = function() {

    if (this.readyState == 4 && this.status == 200) {

      document.getElementById("txtHint").innerHTML = this.responseText;

    }

  };

  xhttp.open("GET", "a.asp?q="+str, true);

  xhttp.send();

}

</script>


 

a.asp

 

<%

response.expires=-1

dim a(2)

a(1)="홈짱닷컴"

a(2)="Homzzang.com"


q=ucase(request.querystring("q"))


if len(q)>0 then

  hint=""

  for i=1 to 2

    if q=ucase(mid(a(i),1,len(q))) then

      if hint="" then

        hint=a(i)

      else

        hint=hint & " , " & a(i)

      end if

    end if

  next

end if


if hint="" then

  response.write("제시어 없음")

else

  response.write(hint)

end if

%>

 

 

 


분류 제목
String JS - toUpperCase() 메서드 - 대문자로 변환
String JS - trim() 메서드 ★ - 문자열양쪽 공백제거 (= trim메서드 = 트림 메서드)
String JS - valueOf() 메서드 - 객체값 (문자열자체 = 밸류어브)
String JS - anchor() 메서드 - name 속성 갖는 앵커태그 (= 링크태그) (비표준)
String JS - big() 메서드 - 큰글씨 (= 큰글자 = 글자 크게) (비표준)
String JS - blink() 메서드 - 글자 깜빡임. (비표준)
String JS - bold() 메서드 - 굵은글씨 (= 글자 굵게) (비표준)
String JS - fixed() 메서드 - 텔레타이프 텍스트 (비표준)
String JS - fontcolor() 메서드 - 글자색깔 (비표준)
String JS - fontsize() 메서드 - 글자크기 (비표준)
String JS - italics() 메서드 - 이탤릭체 (비표준)
String JS - link() 메서드 - src 속성 갖는 앵커태그 (= 링크태그) (비표준)
String JS - small() 메서드 - 작은글씨 (= 글자 작게) (비표준)
String JS - strike() 메서드 - 취소선 (= strike메서드 = 스트라이크메서드, HTML5제외)
String JS - sub() 메서드 - 아래첨자 (비표준) (= sub메서드 = 서브메서드)
String JS - sup() 메서드 - 위첨자 (비표준)
Number JS - Number -
Number JS - constructor - 객체생성자함수 (숫자 경우)
Number JS - MAX_VALUE - JS최대값 (= JS에서 가장큰수)
Number JS - MIN_VALUE - JS최소값 (= JS가장작은값)
7/67
목록
찾아주셔서 감사합니다. Since 2012