users@grizzly.java.net

[Fwd: Re: Helloworld Comet problem]

From: Shing Wai Chan <Shing-Wai.Chan_at_Sun.COM>
Date: Wed, 25 Feb 2009 13:35:47 -0800

fyi ...

attached mail follows:



I have there are some issues in Javascript.
I rewrite it as follows. It is working fine in currently Grizzly workspace.

<script type="text/javascript">
            dojo.require("dojox.cometd");

            function setUp() {
                //dojox.cometd.init("cometd");
                dojox.cometd.startBatch();
                dojox.cometd.init(new String(document.location).replace(/http:\/\/[^\/]*/,'').replace(/\/\/.*$/,'\/cometd')+"cometd");
                dojox.cometd.subscribe("/hello/world", "publishHandler");
                dojox.cometd.endBatch();
            }

            function publishHandler(msg) {
                alert(msg.data.test);
            }

           dojo.addOnLoad(setUp);
        </script>
[Message sent by forum member 'swchan2' (swchan2)]

http://forums.java.net/jive/thread.jspa?messageID=333859

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
For additional commands, e-mail: users-help_at_glassfish.dev.java.net