Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8788927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:15:47+00:00 2026-06-13T22:15:47+00:00

I am following the example from this site to try and implement a live

  • 0

I am following the example from this site to try and implement a live web chat application. I am very new to javascript to jquery, so I thought I’d just copy the example and learn as I go and add things.

This is the code that I am using:

@{
    ViewBag.Title = "OnlineUsers";
}


<html>
<head>
    <title>Online Users</title>
    <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4/leaflet.css" />
    <script src="http://cdn.leafletjs.com/leaflet-0.4/leaflet.js"></script>

</head>
<body>
    <div id="wrapper">
        <div id="upperPanel">
            <div>
                <ul id="messages" itemid="@HttpContext.Current.User.Identity.Name">

                </ul>
            </div>
            <div id="friends">

            </div>
        </div>
        <div id="bottomPanel">
            <textarea rows="2" cols="100" id="chatMessage"></textarea>
            <input id="chatSubmitMessage" type="submit" value="Send" style="margin-left: 10px;" /><br />  
        </div>
    </div>​​​​​​​​​​​​​

    <script type="text/javascript">
        $(function () {
            var pusher = new window.Pusher('0b7eeff567653e170094');
            var channel = pusher.subscribe('chat_channel');
            channel.bind('message_received', function (data) {
                $("#messages").
                append('<li>' + data.user + ' ' + data.message + ' ' + data.timestamp + '</li>');
            });

            $('#chatSubmitMessage').bind('click', function () {
                $.post("/", {
                    chatMessage: $('#chatMessage').val(),
                    username: $('#messages').attr('itemid')
                });
            });
        });
    </script>

    </div>    
</body>
</html>

This code gives me the following error in the Chrome debugger:

Uncaught TypeError: undefined is not a function
(anonymous function)
fire jquery-1.8.2.js:974
self.add jquery-1.8.2.js:1018
jQuery.fn.jQuery.ready jquery-1.8.2.js:246
jQuery.fn.jQuery.init jquery-1.8.2.js:174
jQuery jquery-1.8.2.js:44
(anonymous function)
(anonymous function) jquery-1.8.2.js:564
jQuery.extend.globalEval jquery-1.8.2.js:565
(anonymous function) jquery-1.8.2.js:6006
jQuery.extend.each jquery-1.8.2.js:611
jQuery.fn.extend.domManip jquery-1.8.2.js:5991
jQuery.fn.extend.append jquery-1.8.2.js:5764
jQuery.fn.(anonymous function) jquery-1.8.2.js:6186
$.ajax.success jquery.mobile-1.2.0.js:3685
fire jquery-1.8.2.js:974
self.fireWith jquery-1.8.2.js:1082
done jquery-1.8.2.js:7788
callback

I’m assuming the error has something to do with the function being unnamed, any help will be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:15:48+00:00Added an answer on June 13, 2026 at 10:15 pm

    You are not loading jquery, but trying to use it. Add this to your head

     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am following this example to get JSONP data from remote server. jQuery append
In the following example (from Mozilla's site): <div style=color:darkred> The color of this text
Check this example before reading the question - http://www.sqlfiddle.com/#!2/fcf3e/8 The following data comes from
following some example from Microsoft I created my custom MembershipProvider in my MVC application
I'm completely newbie in PHP. I have tried example code from this site .
I followed the example from this site to eliminate the issues with static vs
I was following example from microsoft site for reading from text file. They say
The following url is formed in my rails application, http://example.com/filter/filters?binding_id=1>1&escape=false&filter_type=publisher_id&from_pagination=0&genre_id=0>57&order=3&page=8&publisher_id=3>160&query=books&search_case=products&sub_category_id=1&tree_filter_id=115&utf8=%E2%9C%93&view_name=generic2d4e4c5333133cd814a2cb102571e4dc Is this OK? If
Please consider the following example code (from the lm doc): ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt
I'm following the racetrack example from Jason Rudolph's book at InfoQ , using grails-1.2.1.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.