SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Opening PDFs in a new window

    Apart from the server-side solution mentioned here in Jakob Nielsen's article, is there any way to force a link to open a PDF in a separate window?

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use JavaScript, but of course users can disable that.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Tommy,

    Thanks for that. Would this be just the same way you would get any new window to open?

    BTW just bought "The Ultimate CSS Reference" - nice piece of work, well done to yourself and Paul.
    Last edited by Enoch Root; Feb 23, 2009 at 05:32.

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Enoch Root View Post
    Hi Tommy,

    Thanks for that. Would this be just the same way you would get any new window to open?
    Yes. For instance,
    Code HTML4Strict:
    <a href="doc.pdf" onclick="return !window.open(this.href, 'PDF')">the document</a>
    (Although, of course, you should use external unobtrusive JavaScript instead of an onclick attribute.)

    Quote Originally Posted by Enoch Root View Post
    BTW just bought "The Ultimate CSS Reference" - nice piece of work, well done to yourself and Paul.
    Thank you!
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    (Although, of course, you should use external unobtrusive JavaScript instead of an onclick attribute.)
    Naturally

    Many thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •