이전 브라우저 (IE5 및 IE6) XMLHttpRequest 객체 사용
이전 브라우저 (IE5 및 IE6) XMLHttpRequest 객체 사용
이전 버전의 Internet Explorer (5/6)는 XMLHttpRequest 객체 대신 ActiveX 객체를 사용합니다.
variable = new ActiveXObject("Microsoft.XMLHTTP");
IE5 및 IE6을 처리하려면 브라우저에서 XMLHttpRequest 객체를 지원하는지 확인하거나 ActiveX 객체를 만듭니다.
예
if (window.XMLHttpRequest) {
// code for modern browsers
xmlhttp = new XMLHttpRequest();
} else {
// code for old IE browsers
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
소스
<!DOCTYPE html>
<html>
<body>
<h2>The XMLHttpRequest Object</h2>
<p id="demo">Let AJAX change this text.</p>
<button type="button" onclick="loadDoc()">Change Content</button>
<script>
function loadDoc() {
var xhttp;
if (window.XMLHttpRequest) {
// code for modern browsers
xhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp.open("GET", "ajax_info.txt", true);
xhttp.send();
}
</script>
</body>
</html>
게시글 목록
| 번호 | 제목 |
|---|---|
| 16181 | |
| 16175 | |
| 16173 |
기타
일반적인 미디어쿼리
4
|
| 16172 |
PHP
특정 ip에서만 모바일 사용
|
| 16170 | |
| 16168 |
PHP
하루전 일주일전 한달전
1
|
| 16167 |
JavaScript
어제날짜, 내일날짜 구하기
|
| 16161 |
JavaScript
날짜형식 체크
2
|
| 16152 | |
| 16145 | |
| 16133 | |
| 16131 | |
| 16128 | |
| 16122 | |
| 16117 |
PHP
php async
3
|
| 16102 | |
| 16099 | |
| 16095 | |
| 16089 |
JavaScript
스택(stack)을 이용한 사칙연산(+ - * /) 계산기
4
|
| 16088 | |
| 16077 |
JavaScript
다양한 카운트다운 소스
6
|
| 16065 |
PHP
간단한 PHP 프레임워크
10
|
| 16060 |
jQuery
atj.js
3
|
| 16055 | |
| 16052 |
JavaScript
네이버 지도 api v3 주소->좌표 변환해서 출력하는 예제
5
|
| 16051 | |
| 16050 | |
| 16046 | |
| 16039 | |
| 16027 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기