Finns det någon basic guide hur sådant fungerar utan extra lullull Pelles Chat är uppbyggd på det sättet, bara att kolla den genererade html-koden så ser du hur det går till... Jo men han har en massa andra koder också så det är inte så lätt att veta vad som inte tillhör och vad som tillhör chatten. Jag gjorde en liknande för ganska många år sedan till ett projekt när jag pluggade. Inte speciellt snyggt, men väldigt enkelt utan massa annat, så här kan du säkert se hur det fungerar: Tacken chatt med iframe och innerHTML
Har hittat en del exempel här men hänger inte riktigt med.
ska vara till PHP och MySQLSv: en chatt med iframe och innerHTML
/JohanSv:en chatt med iframe och innerHTML
Sv: en chatt med iframe och innerHTML
Själva HTML-sidan:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/NDstyle.css" rel="stylesheet" type="text/css">
<link href="css/chat.css" rel="stylesheet" type="text/css">
<title>Chat: Aktuellt</title>
</head>
<body style="background-color: #FFFFFF">
<table cellspacing="0" class="chatmaintable">
<tr>
<td>
<IFRAME src="chat_write.php?ChatID=25" marginwidth="2" marginheight="2" width="540" height="25" scrolling="NO" frameborder="0" name="write"></IFRAME>
<table cellspacing="0" class="chattable">
<tr class="chatrad1">
<td class="chatcoltime"><p id=time1> </p></td>
<td class="chatcoluser"><p id=user1> </p></td>
<td class="chatcolmess"><p id=mess1> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time2> </p></td>
<td class="chatcoluser"><p id=user2> </p></td>
<td class="chatcolmess"><p id=mess2> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time3> </p></td>
<td class="chatcoluser"><p id=user3> </p></td>
<td class="chatcolmess"><p id=mess3> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time4> </p></td>
<td class="chatcoluser"><p id=user4> </p></td>
<td class="chatcolmess"><p id=mess4> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time5> </p></td>
<td class="chatcoluser"><p id=user5> </p></td>
<td class="chatcolmess"><p id=mess5> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time6> </p></td>
<td class="chatcoluser"><p id=user6> </p></td>
<td class="chatcolmess"><p id=mess6> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time7> </p></td>
<td class="chatcoluser"><p id=user7> </p></td>
<td class="chatcolmess"><p id=mess7> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time8> </p></td>
<td class="chatcoluser"><p id=user8> </p></td>
<td class="chatcolmess"><p id=mess8> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time9> </p></td>
<td class="chatcoluser"><p id=user9> </p></td>
<td class="chatcolmess"><p id=mess9> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time10> </p></td>
<td class="chatcoluser"><p id=user10> </p></td>
<td class="chatcolmess"><p id=mess10> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time11> </p></td>
<td class="chatcoluser"><p id=user11> </p></td>
<td class="chatcolmess"><p id=mess11> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time12> </p></td>
<td class="chatcoluser"><p id=user12> </p></td>
<td class="chatcolmess"><p id=mess12> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time13> </p></td>
<td class="chatcoluser"><p id=user13> </p></td>
<td class="chatcolmess"><p id=mess13> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time14> </p></td>
<td class="chatcoluser"><p id=user14> </p></td>
<td class="chatcolmess"><p id=mess14> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time15> </p></td>
<td class="chatcoluser"><p id=user15> </p></td>
<td class="chatcolmess"><p id=mess15> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time16> </p></td>
<td class="chatcoluser"><p id=user16> </p></td>
<td class="chatcolmess"><p id=mess16> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time17> </p></td>
<td class="chatcoluser"><p id=user17> </p></td>
<td class="chatcolmess"><p id=mess17> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time18> </p></td>
<td class="chatcoluser"><p id=user18> </p></td>
<td class="chatcolmess"><p id=mess18> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time19> </p></td>
<td class="chatcoluser"><p id=user19> </p></td>
<td class="chatcolmess"><p id=mess19> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time20> </p></td>
<td class="chatcoluser"><p id=user20> </p></td>
<td class="chatcolmess"><p id=mess20> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time21> </p></td>
<td class="chatcoluser"><p id=user21> </p></td>
<td class="chatcolmess"><p id=mess21> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time22> </p></td>
<td class="chatcoluser"><p id=user22> </p></td>
<td class="chatcolmess"><p id=mess22> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time23> </p></td>
<td class="chatcoluser"><p id=user23> </p></td>
<td class="chatcolmess"><p id=mess23> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time24> </p></td>
<td class="chatcoluser"><p id=user24> </p></td>
<td class="chatcolmess"><p id=mess24> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time25> </p></td>
<td class="chatcoluser"><p id=user25> </p></td>
<td class="chatcolmess"><p id=mess25> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time26> </p></td>
<td class="chatcoluser"><p id=user26> </p></td>
<td class="chatcolmess"><p id=mess26> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time27> </p></td>
<td class="chatcoluser"><p id=user27> </p></td>
<td class="chatcolmess"><p id=mess27> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time28> </p></td>
<td class="chatcoluser"><p id=user28> </p></td>
<td class="chatcolmess"><p id=mess28> </p></td>
</tr>
<tr class="chatrad1">
<td class="chatcoltime"><p id=time29> </p></td>
<td class="chatcoluser"><p id=user29> </p></td>
<td class="chatcolmess"><p id=mess29> </p></td>
</tr>
<tr class="chatrad2">
<td class="chatcoltime"><p id=time30> </p></td>
<td class="chatcoluser"><p id=user30> </p></td>
<td class="chatcolmess"><p id=mess30> </p></td>
</tr>
</table>
</td>
<td class="chatcolonline">
<p id=update>Senast uppdaterad: 00:00:00</p>
<p id=online>Online: </p>
<p>Historik</p>
<p>Logga ut</p>
</td>
</tr>
</table>
<IFRAME src="chat_update.php?ChatID=25" marginwidth="2" marginheight="2" width="0" height="0" scrolling="NO" frameborder="0" name="write"></IFRAME>
</body>
</html>
resultatet från chat_update.php:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta HTTP-EQUIV="Refresh" CONTENT="5;URL=chat_update.php?ChatID=25">
<title>chatuppdatering</title>
</head>
<script language="javascript">
function insert() {
parent.time1.innerHTML="12:46:40";
parent.user1.innerHTML="JohanD";
parent.mess1.innerHTML="<font style=\"color: #CC0000;\"><b>Kommer in</b>!</font>";
parent.time2.innerHTML=" ";
parent.user2.innerHTML=" ";
parent.mess2.innerHTML=" ";
parent.time3.innerHTML=" ";
parent.user3.innerHTML=" ";
parent.mess3.innerHTML=" ";
parent.time4.innerHTML=" ";
parent.user4.innerHTML=" ";
parent.mess4.innerHTML=" ";
parent.time5.innerHTML=" ";
parent.user5.innerHTML=" ";
parent.mess5.innerHTML=" ";
parent.time6.innerHTML=" ";
parent.user6.innerHTML=" ";
parent.mess6.innerHTML=" ";
parent.time7.innerHTML=" ";
parent.user7.innerHTML=" ";
parent.mess7.innerHTML=" ";
parent.time8.innerHTML=" ";
parent.user8.innerHTML=" ";
parent.mess8.innerHTML=" ";
parent.time9.innerHTML=" ";
parent.user9.innerHTML=" ";
parent.mess9.innerHTML=" ";
parent.time10.innerHTML=" ";
parent.user10.innerHTML=" ";
parent.mess10.innerHTML=" ";
parent.time11.innerHTML=" ";
parent.user11.innerHTML=" ";
parent.mess11.innerHTML=" ";
parent.time12.innerHTML=" ";
parent.user12.innerHTML=" ";
parent.mess12.innerHTML=" ";
parent.time13.innerHTML=" ";
parent.user13.innerHTML=" ";
parent.mess13.innerHTML=" ";
parent.time14.innerHTML=" ";
parent.user14.innerHTML=" ";
parent.mess14.innerHTML=" ";
parent.time15.innerHTML=" ";
parent.user15.innerHTML=" ";
parent.mess15.innerHTML=" ";
parent.time16.innerHTML=" ";
parent.user16.innerHTML=" ";
parent.mess16.innerHTML=" ";
parent.time17.innerHTML=" ";
parent.user17.innerHTML=" ";
parent.mess17.innerHTML=" ";
parent.time18.innerHTML=" ";
parent.user18.innerHTML=" ";
parent.mess18.innerHTML=" ";
parent.time19.innerHTML=" ";
parent.user19.innerHTML=" ";
parent.mess19.innerHTML=" ";
parent.time20.innerHTML=" ";
parent.user20.innerHTML=" ";
parent.mess20.innerHTML=" ";
parent.time21.innerHTML=" ";
parent.user21.innerHTML=" ";
parent.mess21.innerHTML=" ";
parent.time22.innerHTML=" ";
parent.user22.innerHTML=" ";
parent.mess22.innerHTML=" ";
parent.time23.innerHTML=" ";
parent.user23.innerHTML=" ";
parent.mess23.innerHTML=" ";
parent.time24.innerHTML=" ";
parent.user24.innerHTML=" ";
parent.mess24.innerHTML=" ";
parent.time25.innerHTML=" ";
parent.user25.innerHTML=" ";
parent.mess25.innerHTML=" ";
parent.time26.innerHTML=" ";
parent.user26.innerHTML=" ";
parent.mess26.innerHTML=" ";
parent.time27.innerHTML=" ";
parent.user27.innerHTML=" ";
parent.mess27.innerHTML=" ";
parent.time28.innerHTML=" ";
parent.user28.innerHTML=" ";
parent.mess28.innerHTML=" ";
parent.time29.innerHTML=" ";
parent.user29.innerHTML=" ";
parent.mess29.innerHTML=" ";
parent.time30.innerHTML=" ";
parent.user30.innerHTML=" ";
parent.mess30.innerHTML=" ";
parent.update.innerHTML="Senast uppdaterad:<br>12:47:48";
parent.online.innerHTML="Användare online:<br>JohanD<br>";
}
</script>
<body onload="javascript:insert();">
</body>
</html>
/Johan
Sv:en chatt med iframe och innerHTML
Få se, har fått ett tips att göra den i flash och flash kan jag ju :)