How to click on a link to open a PDF in a new window while at the same time changing the parent window?
Something like? …
<a href="assets/pdf/a_pdf_doc.pdf" target="new"
onclick="window.parent.location.href='newpage.html';">A PDF Doc</a>
Of course the above doesn’t work….just an example of what I perceive to be close to the answer. Thanks!
You could move the “new window” and the “redirect” functionality into a single JS function. Here’s what that definition might look like:
And then in your HTML:
I would keep the regular
hrefattribute specified in case a user has JS turned off.