|
|
|
2006-05-24 13:39:273085
|
[ajax] ÀÚ¹Ù½ºÅ©¸³Æ®·Î xml¹®¼ °¡Á®¿À±â |
|
È£¼®
|
|
| ÀÏ¹Ý | |
|
[½ºÅ©¸³Æ®] ÀÚ¹Ù½ºÅ©¸³Æ®·Î xml¹®¼ °¡Á®¿À±â
Ãâó phpschool.com
±Û¾´ÀÌ °ÅÄ£¸¶·ç ³¯ Â¥ 02-08-05 18:36 Á¶ ȸ 3294
<xml> ÅÂ±× ¶Ç´Â object ű׷Πxml µµÅ¥¸ÕÆ®¸¦ °¡Á®¿Ã ¼ö Àִٴ°Ŵ ¾Æ½Ç²®´Ï´Ù.
±×·±µ¥ ÀÚ±â ÀÚ½ÅÀÇ ¼¹ö¸¦ ¹ù¾î³ª¸é Á¢±ÙÀÌ ¸·Çô¼ °¡Á®¿Ã ¼ö ¾ø°Ô µÇÁö¿ä..
±Ùµ¥!!! ´Ù¸¥ ¼¹ö¿¡ ÀÖ´Â xml ¹× html µµÅ¥¸ÕÆ®¸¦ ½Ç½Ã°£À¸·Î °¡Á®¿Ã ¼ö ÀÖ´Â ¹æ¹ýÀ» ã¾Ò½À´Ï´Ù. ±Ùµ¥ ÇѱÛÀÌ ±úÁö³×¿ä xmlhttp ¶ó´Â³ÑÀ̶ó¼ ÀÎÄÚµùÀ» µû·Î ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é ±×·¸°Ô µÇ´Â°Å°°Àºµ¥ ÀÎÄÚµùÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Â ¹æ¹ýÀº ¸ð¸£°Ú½À´Ï´Ù. À߸¸ ÀÌ¿ëÇϸé Ŭ¶óÀ̾ðÆ® ½ºÅ©¸³Æ®·Î xml-rpcµµ °¡´ÉÇÒµí ½Í³×¿ä : )
ÇÏÁö¸¸.. ´Ù¸¥ ¹æ¹ýÀ¸·Î ÀÌ°É ÃæºÐÈ÷ ÀÀ¿ëÇÒ¼ö ÀÖ°ÚÁö¿ä.. ÆäÀÌÁö À̵¿ ¾øÀÌ ¼¹ö¿¡ ÀÖ´Â sql¹®À» ½ÇÇàÇÏ°í °á°ú¸¦ ¸®ÅϹ޴´٠µîµî.... (¼¹öÂÊ ÇÁ·Î±×·¥°ú ¿¬µ¿µÇ¾î¾ß ÇÏ°ÚÁö¸¸¿ä)
°£´ÜÈ÷ ½ºÄðÀÇ ¸ÞÀÎÆäÀÌÁö¸¦ °¡Á®¿À´Â ¿¹Á¦¸¦ ¿Ã¸®°Ú½À´Ï´Ù.
<script>
var sHttp = new ActiveXObject("Microsoft.xmlhttp");
function httpGet(szURL) {
sHttp.open("GET",szURL,false);
sHttp.setRequestHeader( "Content-type:", "text/html");
sHttp.onreadystatechange = onRetriveComplete;
sHttp.send();
if (sHttp.status > 200) alert("200 Error");
}
function onRetriveComplete() {
sHttp.onreadystatechange = noop; //re-entrant gate
if (sHttp.readyState == 4) {
document.all('contentView').innerHTML = sHttp.responseText;
}
}
function noop() {
return false;
}
</script>
<body onLoad="httpGet('http://phpschool.com/v2/index.html');">
<div id='contentView' width="100%" height="100%">Wait for loading...</div>
</body>
°ËÀºº° 02-08-06 16:50
ÁÁÀº ÆÁ °¨»çÇÕ´Ï´Ù..
±×¸®°í sHttp.onreadystatechange = noop; //re-entrant gate Àº if¹® ¾È¿¡ ½á¾ß ÇÒ °Í °°½À´Ï´Ù..
ÇÑ°¡Áö ´õ ¿©·¯°¡Áö Å×½ºÆ®ÈÄ ¾Ë¾Æ³½ »ç½ÇÀÔ´Ï´Ù..
¾Æ·¡¿Í °°ÀÌ test.php¸¦ ÀÛ¼ºÇϽðí ÀÌ test.phpÀÇ ÁÖ¼Ò¸¦
httpGetÀÇ ÀÎÀÚ·Î ³Ñ°Ü º¸¼¼¿ä.
<?php
header(\"Content-Type: text/html\\r\\n\");
header(\"Content-Encoding: utf-8\");
header (\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\"); // Date in the past
header (\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\"); // always modified
header (\"Cache-Control: no-cache, must-revalidate\"); // HTTP/1.1
header (\"Pragma: no-cache\"); // HTTP/1.0
echo iconv(\"EUC-KR\",\"UTF-8\",\"Å×½ºÆ®ÀÔ´Ï´Ù\");
// echo \"<a>Å×½ºÆ®ÀÔ´Ï´Ù</a>\";
?>
±×·³ ºê¶ó¿ìÀúÀÇ ÀÎÄÚµù¿¡ °ü°è¾øÀÌ ÇѱÛÀÌ ³ª¿Ô½À´Ï´Ù..
ie 6.0¿¡¼ Å×½ºÆ®ÇßÀ¾´Ï´Ù.
Âü°í°¡ µÇ½Ã±â¸¦...........................
ÁÁÀº ÆÁ °¨»çÇÕ´Ï´Ù..
±×¸®°í sHttp.onreadystatechange = noop; //re-entrant gate Àº if¹® ¾È¿¡ ½á¾ß ÇÒ °Í °°½À´Ï´Ù..
ÇÑ°¡Áö ´õ ¿©·¯°¡Áö Å×½ºÆ®ÈÄ ¾Ë¾Æ³½ »ç½ÇÀÔ´Ï´Ù..
¾Æ·¡¿Í °°ÀÌ test.php¸¦ ÀÛ¼ºÇϽðí ÀÌ test.phpÀÇ ÁÖ¼Ò¸¦
httpGetÀÇ ÀÎÀÚ·Î ³Ñ°Ü º¸¼¼¿ä.
<?php
header(\"Content-Type: text/html\\r\\n\");
header(\"Content-Encoding: utf-8\");
header (\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\"); // Date in the past
header (\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\"); // always modified
header (\"Cache-Control: no-cache, must-revalidate\"); // HTTP/1.1
header (\"Pragma: no-cache\"); // HTTP/1.0
echo iconv(\"EUC-KR\",\"UTF-8\",\"Å×½ºÆ®ÀÔ´Ï´Ù\");
// echo \"<a>Å×½ºÆ®ÀÔ´Ï´Ù</a>\";
?>
±×·³ ºê¶ó¿ìÀúÀÇ ÀÎÄÚµù¿¡ °ü°è¾øÀÌ ÇѱÛÀÌ ³ª¿Ô½À´Ï´Ù..
ie 6.0¿¡¼ Å×½ºÆ®ÇßÀ¾´Ï´Ù.
Âü°í°¡ µÇ½Ã±â¸¦...........................
°ÅÄ£¸¶·ç 02-08-07 09:57
°ËÀºº°´Ô ÁÁÀºÁ¤º¸ °¨»çÇÕ´Ï´Ù. ·ÎÄ®¿¡¼± iconv·Î º¯È¯Çؼ Ãâ·ÂÇÏ¸é µÇ°ÚÁö¸¸ ¿ÜºÎ html ÆÄÀÏÀ» °¡Á®¿À·Á¸é ÀÎÄÚµù Á¦¾àÀ» ¹þ¾î³ª´Â ¹æ¹ýÀ» ¾ó¸¥ »ý°¢ÇØ¾ß ÇÒ²¨ °°³×¿ä : )
|
|
|
|
|
|
|
|
|