我正在尝试在网络程序中实现ChatJS(chatjs.net)。当我添加所有脚本并使用此代码时:
$.chat({
// your user information
user: {
Id: 3,
Name: 'John Silver',
ProfilePictureUrl: 'http://www.foo.com/avatar/123'
},
// text displayed when the other user is typing
typingText: ' is typing...',
// the title for the user's list window
titleText: 'ChatJS demo chat',
// text displayed when there's no other users in the room
emptyRoomText: "There's no one around here.",
// the adapter you are using. There are 2 implementations out of the box:
// SignalRAdapter and LongPollingAdapter (server independent).
adapter: new LongPollingAdapter()
});
Web浏览器抛出错误:
Uncaught TypeError: Object function (e,n){return new x.fn.init(e,n,t)} has no method 'chat' localhost:8000/try2/:253 (anonymous function)
我该如何解决这个问题?如果这不能轻易修复,有人可以推荐一个类似的开源程序吗?
答案 0 :(得分:0)
在我重新检查我的代码之后,我意识到我忘了包含一个JS库。在我加入之后,它就开始工作了。