I'm using jQuery's form plugin (as suggested in a number of threads like this one) to make an Ajax post to a .NET MVC controller and consume the JSON I get back. It works just fine in Chrome, but in some other browsers, including Firefox 3, the form submit results in a "Save or Open this file" dialog box. The JavaScript looks like:
var options = {
dataType: "json",
clearForm: true,
beforeSubmit: hideUpdateField,
success: handleNewsPostSuccess
};
$('div#Updates form').ajaxForm(options);
and meat of the controller response is:
Object response = new { html = RenderPartialViewToString("DisplayNewsPost", np), newpoints = points.ToString() };
return Json(response, "application/json; charset=utf-8");
What am I missing? It's like the submit event isn't getting attached in Firefox and the other problem browsers. I tried making my own submit action using ajaxSubmit instead with a return false in it, but no difference.