ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î


[Ajax] ajax ¿¹Á¦1
9³â Àü
test1.php

<form>
First Name : <input type="text" id="txt1" onkeyup="showHint(this.value)">
</form>
<p>Suggestions : <span id="txtHint"></span></p>


<script>

function showHint(str)
{

        if(str.length==0)
        {
                document.getElementById("txtHint").innerHTML="";
                return;
        }

        xmlHttp = GetXmlHttpObject();
        if(xmlHttp==null)
        {
                alert ("Your browser does not support AJAX!");
                return;
        }

        var url="time.php";
        url=url+"?q="+str;
        url=url+"&sid="+Math.random();
        xmlHttp.onreadystatechange=stateChanged;
        xmlHttp.open("GET",url,true);
        //# true ÀÌ¸é ºñµ¿±â½Ä ó¸®, send() ¸Þ¼Òµå ½ÇÇà½Ã ¼­¹ö¿¡ ¿äûÈÄ ¼­¹öÀÇ ÀÀ´äÀ»
        //# ±â´Ù¸®Áö ¾Ê°í ¹Ù·Î ´ÙÀ½ ÀÚ¹Ù½ºÅ©¸³Æ® ½ÇÇàµÊ
        xmlHttp.send(null);
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
}
catch (e)
{
  // Internet Explorer
  try
  {
   xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch (e)
  {
   xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
}
return xmlHttp;
}


function stateChanged()
{
        if (xmlHttp.readyState==4)
        {
                document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
        }
}


</script>

time.php

<?php
header("Cache-Control: no-cache, must-revalidate");
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Fill up array with names
$a[]="Anna";
$a[]="Brittany";
$a[]="Cinderella";
$a[]="Diana";
$a[]="Eva";
$a[]="Fiona";
$a[]="Gunda";
$a[]="Hege";
$a[]="Inga";
$a[]="Johanna";
$a[]="Kitty";
$a[]="Linda";
$a[]="Nina";
$a[]="Ophelia";
$a[]="Petunia";
$a[]="Amanda";
$a[]="Raquel";
$a[]="Cindy";
$a[]="Doris";
$a[]="Eve";
$a[]="Evita";
$a[]="Sunniva";
$a[]="Tove";
$a[]="Unni";
$a[]="Violet";
$a[]="Liza";
$a[]="Elizabeth";
$a[]="Ellen";
$a[]="Wenche";
$a[]="Vicky";//get the q parameter from URL
$q=$_GET["q"];//lookup all hints from array if length of q>0

if (strlen($q) > 0)
{
        $hint="";
        for($i=0; $i<count($a); $i++)
        {
                if (strtolower($q)==strtolower(substr($a[$i],0,strlen($q))))
                {
                        if ($hint=="")
                        {
                                $hint=$a[$i];
                        }
                        else
                        {
                                $hint=$hint." , ".$a[$i];
                        }
                }
        }
}

// Set output to "no suggestion" if no hint were found
// or to the correct values
if ($hint == "")
{
        $response="no suggestion";
}
else
{
        $response=$hint;
}
//output the response
echo $response;
?>
ÃßõÃßõ : 336 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,615
Ŭ¸¯½Ã url º¹»çÇϱâ
2,614
CSS Hover ¸¦ ÀÌ¿ëÇÑ ±ò²ûÇÑ ÆäÀÌ¡
2,613
½ºÅ©·ÑÇصµ »ó´Ü¿¡ °íÁ¤µÇ´Â ¸Þ´º ¸¸µé±â
2,612
[Á¤±ÔÇ¥Çö½Ä] php ¹®ÀÚ¿­¿¡¼­ ¼ýÀÚ¸¸ ÃßÃâ
2,611
HTML5 Video/Audio CurrentTime/Ended ¹®Á¦Á¡
2,610
audio ¿¤¸®¸ÕÆ®ÀÇ onplay À̺¥Æ® ó¸® ½Ã ÁÖÀÇ»çÇ×
2,609
PHP - $ SERVER ȯ°æº¯¼ö
2,608
Example #1 print ¿¹Á¦
2,607
php `/`±âÁØÀ¸·Î ÀÚ¸£±â
2,606
php ¹®ÀÚ¿­ ÇÔ¼ö
2,605
ÁÖ¼Òµî ÀÎÄÚµùÇؼ­ º¸³»±â
2,604
jquery load() ¸Þ¼Òµå (ºñµ¿±â À¥ÆäÀÌÁö ·Îµå)
2,603
[Ajax] ajax ¿¹Á¦2
[Ajax] ajax ¿¹Á¦1
2,601
[Ajax] JSON (Javascript Object Notation) »ç¿ëÇϱâ
2,600
[jQuery] jQuery.ajax() HTTP ºñµ¿±â µ¥ÀÌÅÍ ±³È¯
2,599
[jQuery] jQuery fadeIn(), fadeOut(), fadeToggle(), fadeTo() ÀÌÇØÇϱâ
2,598
IE6~7 ¹®Á¦ÇØ°á
2,597
Windows Media Player Á¦¾î
2,596
³ª´®°íµñ ±¸±Û À¥ÆùÆ®(Webfont) »ç¿ëÇϱâ
2,595
PHP ¹®ÀÚ¿­ ³ª´©±â - explode()
2,594
[PHP] ceil() , floor(), round() ÇÔ¼ö
2,593
PHP split ÇÔ¼ö¸¦ ÀÌ¿ëÇÑ ¹®ÀÚ¿­ ºÐ¸®
2,592
[CSS] :before,:after È°¿ëÇϱâ - ±¸ºÐ¼±
2,591
CSS border-image ¼Ó¼º
2,590
jquery ±âº»¹®¹ý
2,589
[ÀÚ¹Ù½ºÅ©¸³Æ®] ¼­¼­È÷ ³ªÅ¸³ª°í »ç¶óÁö´Â â
2,588
php¿¡¼­ À̹ÌÁö ÆÄÀÏÀ» ·£´ýÇÏ°Ô ºÒ·¯¿À±â
2,587
php¿¡¼­ sendmail Å×½ºÆ® Çϱâ
2,586
phpÀÇ number format ÇÔ¼ö - ¼ýÀÚ¸¦ õ´ÜÀ§·Î ±¸ºÐ
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.