mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
No injections, better style
This commit is contained in:
@@ -16,7 +16,9 @@ document.getElementById("chat-btn").addEventListener("click", function(){
|
||||
socket.on("chat,"+chan.toLowerCase(), function(data)
|
||||
{
|
||||
var color = intToARGB(hashCode(data.substring(0,8))).substring(0,6);
|
||||
$("#chat").append("<li><span style='color:"+color+";'>"+data.substring(0,8)+"</span>"+data.substring(8)+"</li>");
|
||||
$("#chat").append("<li><span style='color:"+color+";'>"+data.substring(0,8)+"</span></li>");
|
||||
var in_text = document.createTextNode(data.substring(8));
|
||||
$("#chat li:last")[0].appendChild(in_text);
|
||||
document.getElementById("chat").scrollTop = document.getElementById("chat").scrollHeight
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user