title: Ajax for binary data with jQuery?
body: <p>I have a response which may return <code>text/html</code> or <code>application/octet-stream</code>. If I receive html, I'd like to replace part of the page with the returned response data, and if I receive binary data (a file download), I would like to display a message and send the data to the browser so that the user can download the file. Is there any way to do this?</p>