Maybe this seems a really noob question, but I can't figure out what I do wrong. What I want to accomplish is a simple AJAX request. Here is my code on server side:
http.createServer(function(request, response) {
response.writeHead(200, {
"Content-Type": "text/html"
});
response.end("No data to return.");
}).listen(8666);
On client side I use jQuery:
$(document).ready(function() {
$("#magicSend").on("click", function() {
$.ajax({
url: "http://localhost:8666/",
type: "POST"
});
});
});
The problem is, that according to Firebug I'm getting the response headers but not the content. The AJAX call also gets red on Firebug's console, although it shows "200 OK". I know I miss something but can't figure out what.