JavaScript
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
var req = null;
function getXmlHttpRequest()
{
var httpReq = null;
if (window.XMLHttpRequest)
{
httpReq= XMLHttpRequest();
} else if (typeof ActiveXObject != "undefined")
{
httpReq= ActiveXObject("Microsoft.XMLHTTP");
}
return httpReq;
}
//noch nicht nowendig
function chat_submit()
{
return null;
}
//die funktioniert nicht
function chatshow()
{
req = getXmlHttpRequest();
req.onreadystatechange = chatshowfollow;
req.open("GET", "chat.php", true);
req.send(null);
return null;
}
function chatshowfollow()
{
if(req.readyState == 4)
{
document.getElementById("chat_content").innerHTML = req.responseText;
}
return null;
}
</script>
<link rel="stylesheet" href="chat.css" type="text/css">
</head>
</body onload="chatshow()">
<div id="chat_wrap">
<div id="chat_content">
</div>
<div id="chat_input">
<form action="" method="post">
<label for="message">Nachricht:</label><br>
<input type="text" name="message" id="message" value="">
<input type="button" name="chat_submit" id="chat_submit" value="Senden!" onclick="chat_submit()">
</form>
</div>
</div>
</body>
</html>
Alles anzeigen
Die chat.php funzt auch gescheit, es werden keine Fehler angezeigt.
MfG