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

[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

%>

 

 

 

방문 감사합니다. (즐겨찾기 등록: Ctrl + D)

분류 제목
AJAX JS - AJAX - PHP 아작스 예제 ★ (= 입력제시어 = 입력예제)
AJAX JS - AJAX - ASP 아작스 예제 (= 입력제시어 = 입력예제)
AJAX JS - AJAX - DB 아작스 예제 ★ (= 데이터베이스 정보 가져오기) ※ select 태그 optio…
JSON JS - JSON - Introduction (소개)
JSON JS - JSON - Syntax (구문) ★
JSON JS - JSON - JSON vs XML (언어비교)
JSON JS - JSON - Data Types (데이터타입)
JSON JS - JSON - Object (객체)
JSON JS - JSON - Array (배열)
JSON JS - JSON - JSON.parse() 함수 ★ - (JSON문자열 → JS객체) 변환. (= 웹서버와…
JSON JS - JSON - JSON.stringify() 함수 ★ - (JS객체 → JSON문자열) 변환. ※ P…
JSON JS - JSON - PHP (= 서버연동 = DB연동)
JSON JS - JSON - HTML (= 테이블 및 드롭다운 형태로 출력 + 출력개수선택)
JSON JS - JSON - JSONP (= script 이용한 서버연동)
String JS - String - 문자열
String JS - constructor 속성 - 객체생성자함수반환. (문자열 경우)
String JS - length 속성 ★ - 문자열길이 반환 (= length속성 = 렝스속성) ※ 문자개수/텍스트길이…
String JS - prototype 속성(문자열) - 객체에 사용자정의 속성 및 메서드 추가 (프로토타입)
String JS - charAt() 메서드 ★ - 문자열의 지정 위치 문자. (= charAt메서드) ※ 개별문자에 스…
String JS - charCodeAt() 메서드 - 문자열의 지정위치문자의 유니코드 (= charCodeAt메서드 =…
5/67
목록
찾아주셔서 감사합니다. Since 2012