2011-11-17 207 views
1

我用下面的代码显示在IE浏览PDF文档:打开PDF /窗口

<a class="menu" href="file://MyServer/MyFolder/MyFile.pdf">Click Me!</a> 

这显示在当前标签页的PDF ...我怎样才能使这个开放无论是新标签还是新窗口?

回答

6

这是你在新窗口中的显示方式:

<a class="menu" href="file://MyServer/MyFolder/MyFile.pdf" target="_blank">Click Me!</a> 

目标属性可以打开任何一个环节(不仅仅是HTML或PDF)其他或同一窗口。阅读关于它here

 _blank Renders the content in a new window without frames. 
    _parent Renders the content in the immediate frameset parent. 
    _search Renders the content in the search pane. 
    _self Renders the content in the frame with focus. 
    _top Renders the content in the full window without frames. 
4

将“target”属性添加到您的A标记中。例如:

<a class="menu" target="_blank" href="file://MyServer/MyFolder/MyFile.pdf">Click Me!</a>