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 han开发者_C百科dler. But this time im clueless why this is happening. anyone has experienced this problem.. thanks
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.
After some stumbling around, I solved my problem by including links to the following two jquery libs:
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
精彩评论