Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

addMessage

By: enjikaka on Nov 3rd, 2011  |  syntax: JavaScript  |  size: 0.48 KB  |  hits: 40  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function addMessage(time, user, msg) {
  2.         if (msg == "") {
  3.                 return false;
  4.         }
  5.         var m = document.getElementById('message-panel');
  6.         var addThis = document.createTextNode("<div class='sentMessage'><span class='time'>" + time + "</span><span class='name'><a>" + user + "</a></span><span class='message'>" + msg + "</span></div>");
  7.         m.appendChild(addThis);
  8.         pageScroll();
  9.         if (user != "SERVER") {
  10.                 if (user != "ERROR") {
  11.                         playAudio('new-message-sound');
  12.                 }
  13.         }
  14.         return false;
  15. }
  16.