How to open link to pdf file in new tab using html

蹲街弑〆低调 提交于 2019-12-23 08:26:03

问题


I have an html page which contains link to open pdf file. however this link opens in adobe reader when i click on it. I have set target property to blank. but it doesn't work either. I want to open this pdf file in new tab in the same window.


回答1:


target="_blank" is the right way - but if it opens in a new tab, a new window or the adobe reader depends on the users browser-settings and can't (and shouldn't!) be controlled by you.




回答2:


With my websites, I use:

target="_tab" as most browsers are now aware that people want things to open in new tabs instead of new windows. I can confirm that this works for me in the following web browsers:

Opera, Chrome, Flock, Firefox and Maxthon.

However, it still does not work in any version of Internet Explorer, including their new beta version: 9. Apparently it comes down to "User Preferences" with Internet Explorer.

Determining which application opens a particular file format is currently, and should always be left up to the user, not the developer*.



来源:https://stackoverflow.com/questions/2947404/how-to-open-link-to-pdf-file-in-new-tab-using-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!