I have a jquery ajax call that send a request to the node.js app that works fine, the problem is that i can not retrieve any response with the jquery call back.
The Jquery
$(document).ready(function(){
var listing = $('#listing');
$.ajax
({
url: "http://my.ip.is.here:3000/",
cache: false,
//timeout: 5000,
success: function(data)
{
listing.append(data);
}
});
})
Node:
var s = http.createServer(function (req, res) {
req.on('data', function(sock) {
// SEND DATA BACK TO AJAX HERE
});
});
s.listen(3000, 'my.ip.is.here');
console.log('Server running at http://my.ip.is.here:3000/');
How should i do to retreive data from the node.js app into my jquery callback? ( and hopefully while keeping the connection alive )