Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Thanks for this info. The thing is that in one case I'd like to return html (when the data passed wasn't valid - since client side validation fails..) so the user can make changes and post it again. But when the data validated and a new object in the database was created successfully then I'd like to return Json. Is there any way to check the type of returned result? Commented Apr 17, 2010 at 8:01
  • Try setting the MIME type of response: If none is specified, jQuery will intelligently try to get the results, based on the MIME type of the response Commented Apr 17, 2010 at 11:58
  • I believe this is the default behaviour and "if none is specified" in this case means "if you don't set it explicitly" rather than "set it to none". Commented Apr 21, 2011 at 13:41