I am using jQuery .ajax() to call the server (actually the local Django server) and get a response.
On the server console, I see that the JSON request is coming in, it is responsible for the JSON, and everything looks fine.
But in my browser (tested on Firefox 3.6 and Safari 4.0.4, and I'm using jQuery 1.4.2) it seems that the response body is empty (the response code is 200, and the headers otherwise look OK).
Testing the response from the command line, I get the answer that I expect.
$ curl http://127.0.0.1:8000/api/answers/answer/1 --data "text = test & user_name = testy & user_location = testyville & site = http% 3A% 2F% 2Flocalhost% 3A8888% 2Fcs% 2Fjavascript_answer_form .html & email_address = "
{"answer_permalink": " http://127.0.0.1:8000/questions/1 ", "answer_id": 16, "question_text": "What was the sky like when you were young?", "answer_text": "test" , "question_id": "1"}
I am making a request from an HTML file on my local computer that is not served by a web browser. It simply accessed using file:// . The django server is also local, by default 127.0.0.1:8000.
Thanks for any suggestions!
-Jeet
Jim n source share