I have a WebHander that returns a binary file (PDF to be precise). How
can I use AJAX to display that file in the browser? Returned content
type is "application/pdf" and it is sent with the header
"Content-disposition:attachment; filename=report.pdf" so it forces a
download.

var checkedItems = [];
$("[EMAIL PROTECTED]:checked", mytable).each(
        function()
        {
                checkedItems.push(this.value);
        }
);
$.ajax(
{
                type: "POST",
                url: "report.ashx",
                data: "records=" + checkedItems,
                success: function(msg)
                {
                        // what goes here?
                }
        }
);

The only other solution I can think of is to do:

location.href = "report.ashx?records=" + checkedItems

but I would like to avoid that if possible.

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to