如何在 url 参数中传递带有参数的 html url [英] How can i pass a html url with parameters in an url parameter
问题描述
我使用 pdf.js 查看器在 iframe 中嵌入 PDF.为此,我使用:
I use the pdf.js viewer to embed a PDF in an iframe. To do this, I use the:
" ?file=
" ?file= < path-string> " parameter. This path isn't a full path to an PDF file but a URL with own parameters. This own parameters were removed on execution.
如何在参数file"中传递带有参数的 URL?或者:这是另一种使用 URL 运行查看器的方法吗?
How can I pass a URL with parameters in the parameter "file"? Or: Is it another way to run the viewer with an URL?
推荐答案
如这里所写,https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#file,您必须使用 encodeURIComponent() 对您的 URL 进行编码;
As written here, https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#file, you have to encode your URL with encodeURIComponent();
这篇关于如何在 url 参数中传递带有参数的 html url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!