Flotype / now

NowJS makes it easy to build real-time web apps using JavaScript
http://www.nowjs.com
MIT License
1.91k stars 175 forks source link

remote callback not being called #16

Closed scottburch closed 13 years ago

scottburch commented 13 years ago

SERVER

everyone.now.getData = function(callback) { callback(getData()) }

CLIENT

now.ready(function() {
    now.getData(function(data) {
        fillTree(treePanel.getRootNode(), data);
    })
})

I took a wireshark trace and I see the instructions to call the callback (I think) but the callback never gets called. The documentation does not cover this well.

dvv commented 13 years ago

Please, carefully look at the example -- you need to add a second callback at client-side. Just use a noop -- function(){}

ericz commented 13 years ago

Hi scottburch.

If you are running NowJS version < 0.3, then dvv is correct and you will need to use an noop.

However if you are using the latest npm version (0.3.0), I have tested your code and it works for me. Can you provide more information about the exact code and version of NowJS you're using?

Thanks, Eric

scottburch commented 13 years ago

I wrote a minimal example of what I am doing (since I put this in a larger project) and it does work fine. I will try to remove a piece at a time until I figure out what is causing it to fail. I will post here when I find it. Thanks.

I was not sure I was using it correctly.

scottburch commented 13 years ago

Ok, found it. I am using ExtJS and loading ext-base.js causes it to fail. Works if I remove it