简体   繁体   English

在浏览器中打开 pdf 和视频新标签,而不是使用第三方插件下载

[英]Opening a pdf and videos new tab in a browser instead of dowloading using third party plugins

I want to open a pdf or video files in a browser new tab instead of downloading them.我想在浏览器的新标签页中打开 pdf 或视频文件,而不是下载它们。

How should I approach the task?我应该如何处理任务?

Maybe this code can help you也许这段代码可以帮助你

<object data="http://yoursite.com/the.pdf" type="application/pdf" width="750px" height="750px">
    <embed src="http://yoursite.com/the.pdf" type="application/pdf">
        <p>This browser does not support PDFs. Please download the PDF to view it: <a href="http://yoursite.com/the.pdf">Download PDF</a>.</p>
    </embed>
</object>

I don't know about using third party plugins but you can use the target = "_blank" attribute in the HTML <a> tag我不知道如何使用第三方插件,但您可以在 HTML <a>标签中使用target = "_blank"属性

https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_link_target https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_link_target

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM