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 7502951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:03:26+00:00 2026-05-29T21:03:26+00:00

I am trying to create a simple test HTML page which shows messages from

  • 0

I am trying to create a simple test HTML page which shows messages from a Bayeux server.

this is the code:

  <html>
  <head>
     <title>test Baeyux connexion</title>
     <script type="text/javascript" src="jquery/jquery-1.6.2.js"></script>
     <script type="text/javascript" src="jquery/jquery.cometd.js"></script>
     <script type="text/javascript" src="jquery/json2.js"></script>
  </head>
  <body>
  <script type="text/javascript">
     jQuery( document ).ready( function ( $ ) {
        var cometd = $.cometd;

        cometd.init( 'http://localhost:8080/VisionWeb/cometd' );
        cometd.addListener( "/meta/handshake", function ( message ) {

        } );

        cometd.addListener( '/meta/connect', function ( message ) {
           // if (cometd.getStatus() === 'disconnecting' || cometd.getStatus() === 'disconnected')
           if ( cometd.isDisconnected() ) // Available since 1.1.2
           {
              return;
           }
           var wasConnected = _connected;
           _connected = message.successful;
           if ( !wasConnected && _connected ) {
              $( "#con" ).text( "RECONNECTED" );
           }
           else if ( wasConnected && !_connected ) {
              $( "#con" ).text( "DISCONNECTED" );
           } else if ( _connected ) {
              $( "#con" ).text( "ON" );
           } else {
              $( "#con" ).text( "OFF" );
           }
        } );

        cometd.addListener( '/meta/disconnect', function ( message ) {
           if ( message.successful ) {
              _connected = false;
           }
        } );
     });
  </script>
  <p>connexion is <span id="con">UNDEFINED</span></p>

  <p>comet messages</p>
  <ul id="msg"></ul>
  </body>
  </html>

when I try to open this page I get the following javascript error: org is not defined
at line 20 of jquery.cometd.js. The line in question is:

org.cometd.JSON.toJSON = JSON.stringify;

this is a library I downloaded and I guess I am doing something wrong here but I have no clue as to what it is.

thanks in advance,
Micha

  • 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-05-29T21:03:28+00:00Added an answer on May 29, 2026 at 9:03 pm

    You haven’t included the cometd javascript library. This must be done before including jquery.cometd.js. jquery.cometd.js is just the glue that joins cometd and jquery together. Try ordering your scripts more like this:

        <script type="text/javascript" src="/org/cometd.js"></script>
        <script type="text/javascript" src="/org/cometd/ReloadExtension.js"></script>
        <script type="text/javascript" src="/jquery/jquery-1.6.4.js"></script>
        <script type="text/javascript" src="/jquery/json2.js"></script>
        <script type="text/javascript" src="/jquery/jquery.cookie.js"></script>
        <script type="text/javascript" src="/jquery/jquery.cometd.js"></script>
        <script type="text/javascript" src="/jquery/jquery.cometd-reload.js"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a very simple REST server. I just have a test
I am trying to create a simple page that enters data in to a
I'm trying to create a simple Add-On for SQL Server 2008; it is simply
I'm trying to create a simple JavaScript test front-end for my WCF service, but
I am having an issue with this site - http://thestamp.umd.edu/canvastest/test.html I'm trying to build
I'm trying to create a simple ajax load test script that dynamically creates divs,
Im trying to create a simple pan and zoom app using silverlight 4, but
I am trying to create a simple dialog in MFC using Visual C++. My
I'm trying to create a simple BaSH-like grammar on ANTLRv3 but haven't been able
I'm trying to create a simple toggling sidebar using jquery, where it expands and

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.