이전 브라우저 (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>
게시글 목록
| 번호 | 제목 |
|---|---|
| 16286 | |
| 16281 | |
| 16277 | |
| 16276 |
JavaScript
video를 연속으로 재생
|
| 16268 |
node.js
nodejs 환경변수 설정하기 ^^ 영상있음
4
|
| 16266 | |
| 16264 | |
| 16263 | |
| 16262 | |
| 16259 | |
| 16258 |
JavaScript
소수점 지원하는 Math.round
|
| 16257 |
기타
스크린샷이 필요할때?
|
| 16255 | |
| 16233 | |
| 16229 |
jQuery
select 선택에 따라 테두리 색상 변경
3
|
| 16222 | |
| 16220 |
MySQL
mysql 속도 증가
6
|
| 16219 | |
| 16217 | |
| 16214 | |
| 16213 | |
| 16211 |
JavaScript
공휴일관련 정부 데이터 api
2
|
| 16207 | |
| 16205 | |
| 16197 | |
| 16195 | |
| 16192 | |
| 16191 |
JavaScript
남은시간 카운트하는 자바스크립트
1
|
| 16188 |
MySQL
스팸글 삭제 문의
1
|
| 16187 |
MySQL
비회원글삭제 방법문의
1
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기