我正在尝试在web程序中实现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)我怎么才能解决这个问题?如果这个问题不容易解决,有人能推荐一个类似的开源程序吗?
发布于 2013-12-31 15:42:43
在重新检查代码之后,我意识到我忘记了包含一个JS库。我把它包括进去后,它就开始起作用了。
https://stackoverflow.com/questions/20805080
复制相似问题