如何在ASP.NET中创建类似于Gmail或Facebook的聊天应用程序
我正在使用SignalR使用简单的聊天概念在ASP.NET中开发Web应用程序,但我对此不满意。我打算用于Gmail或Facebook等聊天应用。我已经下载了ChatJs,但我不知道如何在我的网络应用程序中安装该插件。
I am developing a web application in ASP.NET with simple chat concept using SignalR,but I am not satisfied with it. I am intended towards chat app like Gmail or Facebook. I have downloaded ChatJs but I dont know how to install that plugin in my web applicaion.
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.signalR-1.1.4.js" type="text/javascript"></script>
<script src="signalr/hubs" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<script type="text/javascript">
$(function () {
var IWannaChat = $.connection.myChatHub;
IWannaChat.client.addMessage = function (message) {
$('#listMessages').append('<li>' + message + '</li>');
};
$("#SendMessage").click(function () {
IWannaChat.server.send($('#txtMessage').val());
});
$.connection.hub.start();
});
</script>
<div>
<input type="text" id="txtMessage" />
<input type="button" id="SendMessage" value="broadcast" />
<ul id="listMessages">
</ul
</div>
</form>
</body>
这是我为简单的聊天应用程序编写的代码。有人在下载chatjs插件后告诉他们的步骤吗?我搜索了很多,但我没有得到确切的我想要的是!请帮忙。我是.Net.Thanks的新手!!
This is the code that I have written for simple chat application.Could anyone tell the steps after downloading the chatjs plugin?I searched for that a lot but I didn't get exactly what I want! Please help. I am new to .Net.Thanks in advance!!
(function(){
var IWannaChat =
(function () { var IWannaChat =
.connection.myChatHub;
IWannaChat.client.addMessage = function(message){
.connection.myChatHub; IWannaChat.client.addMessage = function (message) {
('#listMessages')。append( '< li > '+消息+'< / li > ');
};
('#listMessages').append('<li>' + message + '</li>'); };