URL指向PDF文件时,如何在弹出窗口中设置标题? [英] How to set title in window popup when URL points to a PDF file?

查看:77
本文介绍了URL指向PDF文件时,如何在弹出窗口中设置标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在javascript中,我创建一个指向PDF的URL,然后打开一个新窗口.窗口标题包含我要向用户隐藏的URL.

In javascript I create a URL which points to a PDF and open a new window. The window title contains the URL which I would like to hide from the user.

我尝试了以下建议在弹出窗口中设置标题,但这似乎不适用于PDF.

I tried the following suggestion Set title in the window popup but this doesn't seem to work for PDFs.

有没有办法解决这个问题?

Is there a way to solve this problem?

推荐答案

您不能以这种方式隐藏URL,但是您可以创建一个包含自定义内容的弹出窗口,并将PDF文件嵌入其中,而不是直接链接到PDF文件.

You cannot hide the URL that way, but you can create a popup window with custom content and embed the PDF file inside, instead of directly linking to the PDF file.

赞:

<html>
<head>
<title>This is your title</title>
</head>
<body>
<iframe src="your_pdf_file_link"></iframe>
</body>
</html>

但是,如果客户端没有PDF插件,他们将始终收到另存为"对话框.

But if the client don't have a PDF plugin, they will always receive a "Save As" dialog.

这篇关于URL指向PDF文件时,如何在弹出窗口中设置标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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