Opened 10 years ago

Closed 10 years ago

#14982 closed defect (invalid)

dojo.require("dojox.cometd"); doesn't work in 1.7.2

Reported by: creakytrain Owned by: creakytrain
Priority: undecided Milestone: tbd
Component: Dojox Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:


Bringing in dojox.cometd doesn't work. dojox.cometd will be an undefined object.

Try the example below which comes straight from the dojox.cometd example on the website:

    <script src="//"></script>
    <!-- then try this for version 1.7.1 and it will work fine
      <script src="//"></script>
    <script type="text/JavaScript">
    dojox.cometd.subscribe("/demo", function(message){
        console.log("received", message);
            appendChild(document.createTextNode( + ": " +;
    dojo.connect(dojo.byId("send"), "onclick", function(){
        if(!dojo.byId("sendName").value.length || !dojo.byId("sendText").value.length){
                            alert("Please enter some text");

                    dojox.cometd.publish("/demo", {
             from: dojo.byId("sendName").value,
             text: dojo.byId("sendText").value


<div id="chatroom">
    <div style="clear: both;"><label for="sendName" style="float: left; width: 100px; padding: 3px;">Name:</label> <input id="sendName" typ\
e="text" data-dojo-type="dijit.form.TextBox"></div>
    <div style="clear: both;"><label for="sendText" style="float: left; width: 100px; padding: 3px;">Message:</label> <input id="sendText" \
type="text" data-dojo-type="dijit.form.TextBox"><button id="send" data-dojo-type="dijit.form.Button">Send Message</button></div>
    <div id="messageLog"><strong>Messages:</strong></div>


Change History (5)

comment:1 Changed 10 years ago by bill

Owner: set to creakytrain
Status: newpending

Hmm, neither 1.7.1 or 1.7.2 is working for me since isn't a valid link. (Dojo campus is gone.)

And I'm not seeing any sort of initial error when it points to 1.7.2 about dojox.cometd being undefined.

Can you explain what exact error you are seeing, and give a test case that works better against 1.7.1?

comment:2 Changed 10 years ago by bill

Component: GeneralDojox

comment:3 Changed 10 years ago by dylan

At the moment, you should use the code that's contained within the CometD project, e.g.

We're working with them to get this fully updated for AMD in the near future.

comment:4 in reply to:  3 Changed 10 years ago by Nick Fenwick

Replying to dylan:

At the moment, you should use the code that's contained within the CometD project, e.g.

Just to confirm, I've been using the cometd 2.4.0 release in a dojo 1.7.2 without major problems. Of course you have to run the 2.4.0 cometd server somewhere. I use AMD syntax, and so long as you leave "async:false" in your data-dojo-config to avoid loader bugs to do with the ready() system not working, you should be fine.

How to get the javascript client and overwrite what's shipped in dojo is explained here: under "The non-maven way".

comment:5 Changed 10 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.