> Find the Title with PHP
please fix this html code so it can be properly executed
<!DOCTYPE html>
<html>
<!-- Programming Challange -->>
<head>
</head>
<body>
<title> Find the Title with PHP </title>
<script language="JavaScript" type="text/javascript">
//str is passed to the function
function showHint(str)
{
//nothing is typed return
if (str.length==0)
{
document.getElementById("txtHint").innerHTML="";
return;
}
//check
if (window.XMLHttpRequest)
{
var xmlhttp = new XMLHttpRequest;
}
else //older
{
var xmlhttp =new ActiveXObject("Microsoft.XMLHTTP");
}
//change event
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState==4&&xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
//open
xmlhttp.open("GET", "gethint.php?q="+str, true);
xmlhttp.send();
}
</script>
</body>
</html>
Step by step
Solved in 2 steps