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 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题