I'm writing a custom web server. When I enter the URL of my server in the browser, I get the sample text I write out to the socket in my browser correctly. This is the HTTP response that I write:
HTTP/1.1 200 OK\r\n
Server: My Server\r\n
Date: Blah\r\n
Content-Type: text/plain\r\n
\r\n
This is some sample text. This appears in my browser correctly when I connect directly to the server entering the URL.
However, if I use Ajax (jQuery) to access the same URL and then set the innerHTML of an element on the HTML page, I do not get any data printed. Is there any other header I need to set on my web server so that the browser's XMLHttpRequest object detects the response?