我必须在新窗口中打开 pdf 文件。但是当它在新窗口中打开时,它会显示完整路径,包括 IP 地址作为页面标题。我的需要是我必须手动给出标题。
最佳答案
更改弹出窗口标题的最简单方法是将 PDF 文件(例如使用 iframe)嵌入到具有所需标题的“包装”网页中,然后在弹出窗口中打开包装页面。像这样的事情:
<!DOCTYPE html>
<meta charset=utf-8>
<title>Form 1040</title>
<style type="text/css">
BODY { margin: 0; padding: 0 }
IFRAME { position: absolute; width: 100%; height: 100%; border: 0 }
</style>
<body>
<iframe src="http://www.irs.gov/file_source/pub/irs-pdf/f1040.pdf"></iframe>
</body>
关于javascript - IP 名称和路径显示在窗口上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13597525/