views:

373

answers:

1

i am submitting a from using jQuery ajax, and server is returning json response. but instead of the script, parsing the json result, the browser is prompting me to download the json response.

I have had this problem before, where i forgot to return false at the end of the event handler. But this time im clueless why this is happening. anyone has experienced this problem.. thanks

A: 

If the browser is trying to download a file, it most probably related to content-type of your response. You are using something that the browser considers to be binary and unsafe. Try using text/plain, text/html, text/xml or something like it.

alemjerus