Reputation: 1133
I'm loading pdf's into an iframe on my web page by setting the src of the iframe to the path of the pdf document. This works as I'd like for viewing the pdf.
The problem is that some of the pdf's have hyperlinks in them to external websites which, when clicked, load the external website in my iframe.
So my question is: is it possible to catch the pdf's hyperlink click in javascript in the parent browser window, set the target to either top or blank and then redirect the request?
Unfortunately the pdf's are supplied by a third party so I don't have access to change the documents themselves.
Upvotes: 1
Views: 813
Reputation: 5043
Some ideas:
After you catch the change, you can redirect and open a window with the proper url. But browsers may block the JS pop-up window.
Upvotes: 2