Tag: 附件

jQuery.post()如何处理Content-Disposition:attachment?

在这里略显疯狂。 我正在使用jQuery.post进行Ajax调用,如下所示: $.post(‘php/print.php’,{data:dS},function(res){… },”text”); 我从print.php返回(作为测试): header(“Content-type: application/vnd.ms-word”); header(“Content-Disposition: attachment;Filename=test.doc”); echo “”; echo “”; echo “”; echo “Testing-2-3!”; echo “”; echo “”; 根据Firebug,包括标题在内的数据很好。 但是如何让浏览器(在本例中为Firefox)提示用户保存附件? 谢谢。