Ruso wrote:
JC wrote:
How can I modify this script, so that it opens in a new window ?
<FORM>
<INPUT TYPE="BUTTON" VALUE="Download Application"
ONCLICK="window.location.href='Employment_Applicat ion.pdf'">
</FORM>
<FORM>
<INPUT TYPE="BUTTON" VALUE="Download Application"
ONCLICK="window.open('Employment_Application.pdf') ">
</FORM>
Which makes the linked file inaccessible to browsers without script
support, that don't understand what to do with a PDF file, or that
over-zealously block popups.
Use a link for links, that's what they're for. Tell users that the
file is a PDF, they can then decide for themselves what to do with it
or rely on their browser's settings to decide for them.
If the OP *really* wants to use a popup, then use:
<a href="doc.pdf" onclick="return openPopup(this.href);">...</a>
Where openPopup() returns true or false depeding on the success of the
function. How to write a openPopup() is explained reasonably well
here:
<URL:
http://developer.mozilla.org/en/docs/DOM:window.open >
--
Fred