最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Open .docx file in new tab from anchor tag - Stack Overflow

programmeradmin1浏览0评论

I have included docx file for terms and condition in our project.

Now i need to open it in new tab.

I agree to this Email campaign <a title="click to view terms and conditions" style="color:blue;" target="_blank" href="{$Site.ContentPath}/public/EmailServicesTermsofUse.docx">terms and conditions</a>.

However it is downloading the file rather than opening it new tab.

How can i achieve this. I am open for any kind of solution that will meet this condition.

Thanks in Advance!!!

I have included docx file for terms and condition in our project.

Now i need to open it in new tab.

I agree to this Email campaign <a title="click to view terms and conditions" style="color:blue;" target="_blank" href="{$Site.ContentPath}/public/EmailServicesTermsofUse.docx">terms and conditions</a>.

However it is downloading the file rather than opening it new tab.

How can i achieve this. I am open for any kind of solution that will meet this condition.

Thanks in Advance!!!

Share Improve this question edited Nov 25, 2013 at 10:30 Milind Anantwar asked Nov 25, 2013 at 10:19 Milind AnantwarMilind Anantwar 82.2k26 gold badges96 silver badges128 bronze badges 0
Add a ment  | 

2 Answers 2

Reset to default 3

You can't directly view doc or docx files in html pages like PDF file.

You have to use some docx extractor to extract the contents and display it in Html Page.Provide more details about your application.

For Java Application:- docx4j is suitable for extracting docx files.

Most browsers by default won't load a .docx in the browser. You might have better luck hosting it as a .pdf.

发布评论

评论列表(0)

  1. 暂无评论