本文介绍了是否可以使用jQuery生成PDF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Ajax功能来检索我的内容,并且在jQuery.ajax()
成功时需要导出PDF.我该怎么办?
I am using Ajax functionality to retrieve my content and I need to export PDF on success of jQuery.ajax()
. How can I do that?
推荐答案
jQuery无法(因为JavaScript无法)从数据创建PDF,否...它无法从您的服务器获取(例如其他任何请求),但无法生成一个请求. JavaScript根本没有一种机制(尽管现在正在实现一些HTML5选项)来创建/保存一个可以跨浏览器工作的文件,尤其是二进制文件.
jQuery cannot (because JavaScript cannot) create a PDF from data, no...it can get one from your server (like any other request), but it cannot generate one. JavaScript simply doesn't have a mechanism (though there are some HTML5 options being implemented now) to create/save a file that works cross-browser, especially a binary file.
这篇关于是否可以使用jQuery生成PDF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!