Can someone please help/offer advice?

Discussion in 'JavaScript' started by Ribbon, Jun 21, 2009.

  1. #1
    I am trying have a .pdf file named information.pdf to open in new window when someone clicks on the link. I can't get it to open in a new window. It opens in the same window. Any help would be greatly appreciated. Thanks.

    (Previous code removed)

    Logic Ali solved the problem. Thanks Logic Ali!
     
    Ribbon, Jun 21, 2009 IP
  2. Logic Ali

    Logic Ali Well-Known Member

    Messages:
    170
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #2
    <a href="information.pdf" target='_blank'>PDF document</a>
    Code (markup):
    If your doctype doesn't allow the target atribute:

    <a href="information.pdf" id='pdfLink'>PDF document</a>
    
    <script type="text/javascript">
    document.getElementById( 'pdfLink' ).target = '_blank';
    </script>
    
    Code (markup):
     
    Logic Ali, Jun 21, 2009 IP
  3. Ribbon

    Ribbon Member

    Messages:
    57
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #3
    I going to try the second one now. I will report back. Thanks for your help.
     
    Ribbon, Jun 21, 2009 IP
  4. Ribbon

    Ribbon Member

    Messages:
    57
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #4
    Logic Ali,

    Thank you so much. It works! I have tried that other codes for hours. I appreciate your help.
     
    Ribbon, Jun 21, 2009 IP