javascript - Not return HTML back in C# -
i've got chathub this
public class chathub : hub { public void send(string message) { if(message.length > 0) { string name = context.user.identity.name; clients.all.broadcastmessage(name, message); } } }
problem if user enters message
<strong>hello</strong>
it returned chat like
hello
how can make return <strong>hello</strong>
?
where display (js)
chat.client.broadcastmessage = function (name, message) { $('#chat-table').append(name + ': ' + message); };
use .text
$('#chat-table').text(name + ': ' + message);
Comments
Post a Comment