Uncaught TypeError: Функция объекта

Я пытаюсь реализовать 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()
});

Веб-браузер выдает ошибку:

Uncaught TypeError: Object function (e,n){return new x.fn.init(e,n,t)} has no method 'chat' localhost:8000/try2/:253 (anonymous function)

Как я могу это исправить? Если это не может быть легко исправлено, может кто-нибудь порекомендовать подобную программу с открытым исходным кодом?

1 ответ

Решение

После того, как я перепроверил свой код, я понял, что забыл включить библиотеку JS. После того, как я включил его, он начал работать.

Другие вопросы по тегам