File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to open pdf file by clicking on jsp link tag using javascript

SaiManasa Dasari
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a "a" tag and clicking on that a PDF file should open(Not in a browser.It should open directly)
<a " onclick="openFile('<%=filepath%>')" >filename</a>

This is my javascript code...

function openFile(path)
but its not working.
pdf file and jsp are in different locations and filepath is an entire path of file which it exist like /home/Document1_1345617151061/Consolidate.pdf..
please provide me the solution.

I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic