hi. in SO you can search for tags without pressing enter.
i want to know:
- are the tags retrieved from the database or from a XML file?
- is ajax involved?
i am new at front end. if ajax is involved. how should i write the code?
i want it to access a php file which returns the data. but im not familiar with how it works practically.
should the code look something like this:
<html>
<body>
<script type="text/javascript">
function ajaxFunction()
{
var xmlhttp;
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{
// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
{
document.myForm.time.value=xmlhttp.responseText;
}
}
xmlhttp.open("GET","time.php",true);
xmlhttp.send(null);
}
</script>
<form name="myForm">
Name: <input type="text" name="username" onkeyup="ajaxFunction();" />
Time: <input type="text" name="time" />
</form>
</body>
</html>
how do i send the text the user typed after he released the key to php? and how should i return the values after php has fetched the tags with SELECT. echo?
plz guide me a little. im so confused when front end is involved.