bug^君 2020-02-21 02:38 采纳率: 25%
浏览 229

在AJAX中使用pdf.js

I run a phpBB board, where I'd like to incorporate pdf.js for pdf presentation (so I can include it in a lightbox; but, I digress). Attachments in phpBB are retrieved using a id, invoking file.php.

Here's a webpage where I present three thumbnails for a pdf: http://59plymouth.net/lightbox/pdfjs2.html

If you click on the first thumbnail, it presents a pdf using pdf.js, but without invoking file.php.

If you click on the second thumbnail, it presents a pdf by invoking file.php, but using the native pdf app for presentation (i.e., w/o pdf.js).

If you click on the third thumbnail, it attempts to present the pdf with a combination of file.php and pdf.js: ...href="./pdfjs/web/viewer.html?file=./download/file.php?id=16187

But of course, the second "?" that invokes file.php is treated literally as data, and not as a query. I've surmised enough to know that I have to use AJAX to accomplish what I want to do, but I don't know how to do it. Can someone point me in the right direction?

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献