I have a JavaScript file which uses an Ajax call to another JavaScript file (which runs server commands and produces a JSON result string).
$.getJSON("fileWithServerData.js", function (data) {
//use data here
});
No PhP here!
How can I then return my JSON string to the Ajax call?
var socket;
socket = io.connect('http://localhost:5000');
socket.on('Id', AFunction);
function AFunction(data) {
//send data back to the calling JavaScript file
//???
//???
console.log(data) // does NOT work
//???
}