[ajax] XMLHttpRequest 객체 얻는 함수(크로스 브라우저 코드)
로빈아빠
본문
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> XMLHttpRequest객체 구하기 </title>
<meta http-equiv="Content-Type" content="text/html; charset='EUC-KR'" />
<script type="text/javascript">
//<![CDATA[
function getHTTPObject() {
var xhr = false;
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try{
xhr = new ActiveXObject("Msxml2.XMLHTTP");
} catch (E) {
try {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
} catch(E) {
xhr = false;
}
}
}
return xhr;
}
//]]>
</script>
</head>
<body>
</body>
</html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> XMLHttpRequest객체 구하기 </title>
<meta http-equiv="Content-Type" content="text/html; charset='EUC-KR'" />
<script type="text/javascript">
//<![CDATA[
function getHTTPObject() {
var xhr = false;
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try{
xhr = new ActiveXObject("Msxml2.XMLHTTP");
} catch (E) {
try {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
} catch(E) {
xhr = false;
}
}
}
return xhr;
}
//]]>
</script>
</head>
<body>
</body>
</html>
관련링크
댓글목록
등록된 댓글이 없습니다.