如何在 url 参数中传递带有参数的 html url [英] How can i pass a html url with parameters in an url parameter

查看:66
本文介绍了如何在 url 参数中传递带有参数的 html url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 pdf.js 查看器在 iframe 中嵌入 PDF.为此,我使用:

I use the pdf.js viewer to embed a PDF in an iframe. To do this, I use the:

" ?file= " 参数.此路径不是 PDF 文件的完整路径,而是带有自己参数的 URL.这个自己的参数在执行时被删除.

" ?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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆