<html> <head><base href=”http://www.ajaxdaddy.com/ajax/ajax-chat/“>     <style type=”text/css”>       body {color: white;background: #52616F;}        a { color: white; }     </style> <title>Ajax Chat 3.1 (Room 1)</title> <style type=”text/css”>body    { padding-left:40px; background:#57767F; font-family:arial;}input, textarea  { font-family: arial; color:white; background:#57767F; font-size: 14px; }#content   { width:500px; text-align:left; margin-left:10px; }#chatwindow   { border:1px solid #aaaaaa; padding:4px; background:#232D2F; color:white; width:450px; height:auto; font-family:courier new;}#chatnick   { border: none; border-bottom:1px solid #aaaaaa; padding:4px; background:#57767F;}#chatmsg   { border: none; border-bottom:1px solid #aaaaaa; padding:4px; background:#57767F; }#info    { text-align:left; padding-left:0px; font-family:arial; }#info td   { font-size:12px; padding-right:10px; color:#DFDFDF; }#info .small   { font-size:12px; padding-left:10px; padding-right:0px;}#info a   { text-decoration:none; color:white; }#info a:hover   { text-decoration:underline; color:#CF9700;}</style> </head> <body>  <div id=”info”>  <br>   <table border=”0″>    <tr>     <td colspan=”2″>      <a href=”http://linuxuser.at/index.php?title=Most_Simple_Ajax_Chat_Ever”><font style=”font-size:16px”>Most Simple Ajax Chat</a> (v 3.1)</font><br>     </td>     </tr>       </table>       </div>      <div id=”content”>   <p id=”chatwindow”> </p>  <!–   <textarea id=”chatwindow” rows=”19″ cols=”95″ readonly></textarea><br>–>   <input id=”chatnick” type=”text” size=”9″ maxlength=”9″ >    <input id=”chatmsg” type=”text” size=”40″ maxlength=”80″ onkeyup=”keyup(event.keyCode);”>    <input type=”button” value=”add” onclick=”submit_msg();” style=”cursor:pointer;border:1px solid gray;”><br><br>   <br>  </div> </body></html><script type=”text/javascript”>/******************************************** ******************** * Most Simple Ajax Chat Script (www.linuxuser.at)  * * Version: 3.1       * *         * * Author: Chris (chris[at]linuxuser.at)   * * Contributors: Derek, BlueScreenJunky (http://forums.linuxuser.at/viewtopic.php?f=6&t=17) *        * * Licence: GPLv2      * ******************************************************* *********/ /* Settings you might want to define */ var waittime=800;  /* Internal Variables & Stuff */ chatmsg.focus() document.getElementById(”chatwindow”).innerHTML = “loading…”; var xmlhttp = false; var xmlhttp2 = false;/* Request for Reading the Chat Content */function ajax_read(url) { if(window.XMLHttpRequest){  xmlhttp=new XMLHttpRequest();  if(xmlhttp.overrideMimeType){   xmlhttp.overrideMimeType(’text/xml’);  } } else if(window.ActiveXObject){  try{   xmlhttp=new ActiveXObject(”Msxml2.XMLHTTP”);  } catch(e) {   try{    xmlhttp=new ActiveXObject(”Microsoft.XMLHTTP”);   } catch(e){   }  } } if(!xmlhttp) {  alert(’Giving up
Cannot create an XMLHTTP instance’);Â Â return false;Â }Â xmlhttp.onreadystatechange = function() {Â if (xmlhttp.readyState==4) {Â Â document.getElementById(”chatwindow”).innerHTML = xmlhttp.responseText;Â Â zeit = new Date(); Â Â ms = (zeit.getHours() * 24 * 60 * 1000) + (zeit.getMinutes() * 60 * 1000) + (zeit.getSeconds() * 1000) + zeit.getMilliseconds(); Â Â intUpdate = setTimeout(”ajax_read(’chat.txt?x=” + ms + “‘)”, waittime)Â Â }Â }Â xmlhttp.open(’GET’,url,true);Â xmlhttp.send(null);}/* Request for Writing the Message */function ajax_write(url){Â if(window.XMLHttpRequest){Â Â xmlhttp2=new XMLHttpRequest();Â Â if(xmlhttp2.overrideMimeType){Â Â Â xmlhttp2.overrideMimeType(’text/xml’);Â Â }Â } else if(window.ActiveXObject){Â Â try{Â Â Â xmlhttp2=new ActiveXObject(”Msxml2.XMLHTTP”);Â Â } catch(e) {Â Â Â try{Â Â Â Â xmlhttp2=new ActiveXObject(”Microsoft.XMLHTTP”);Â Â Â } catch(e){Â Â Â }Â Â }Â }Â if(!xmlhttp2) {Â Â alert(’Giving up
Cannot create an XMLHTTP instance’);Â Â return false;Â }Â xmlhttp2.open(’GET’,url,true);Â xmlhttp2.send(null);}/* Submit the Message */function submit_msg(){Â nick = document.getElementById(”chatnick”).value;Â msg = document.getElementById(”chatmsg”).value;Â if (nick == “”) { Â Â check = prompt(”please enter username:”); Â Â if (check === null) return 0; Â Â if (check == “”) check = “anonymous”; Â Â document.getElementById(”chatnick”).value = check;Â Â nick = check;Â } Â document.getElementById(”chatmsg”).value = “”;Â ajax_write(”w.php?m=” + msg + “&n=” + nick);}/* Check if Enter is pressed */function keyup(arg1) { Â if (arg1 == 13) submit_msg(); }/* Start the Requests!
*/var intUpdate = setTimeout(”ajax_read(’chat.txt’)”, waittime);</script>Â Â Â Â Â





















Yorum Yapilmamis
Uzgunum bu yaziya sadece kayitli kullanicilar yorum yapabilir!