Created
January 23, 2011 14:09
-
-
Save kamito/792103 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
socket.onmessage = function(response) { | |
var data = response.data; | |
var name_txt = data.user + " : "; | |
var message_txt = data.message + " (" + data.updated_at + ")"; | |
var tbody = goog.dom.getElement("messages"); | |
var th_name = goog.dom.createDom("th", {style:"text-align:right;"}, name_txt); | |
var td_message = goog.dom.createDom("td", {}, message_txt); | |
var tr = goog.dom.createDom("tr", {}, [th_name, td_message]); | |
tbody.insertBefore(tr, tbody.childNodes[0]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment