SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)

    target=some file

    Hello cloaked and hooded gurus; I come asking advice. I think I know what I want to do but need some eyes and brains to check me on this.

    I'm re-writing a site which currently, in the menu, has three clickies which use "TARGET" to open PDF forms. The current site not only doesn't have a doctype, it doesn't even have html tags, so I decided on starting out with html 4.01 strict. Strict means no target (not that I should be using them anyway) but this being a new file I don't have the normal option of just taking the user to the new link like I normally do.

    I don't know much about pdf's and accessibility, but I know if I have the choice of viewing an html version or a pdf version, I prefer html. Loads quicker, I can copy and paste text, etc.

    My plan is to (eventually) convert these pdf forms into actual online forms, which sit in a new page that is a normal link without target anything, and a clickie to the pdf for those who still like to print, write and mail forms. Though then again I'm not sure how those anchors should look... is opening a file a behaviour? If so, what do I do for those without Js (or firewall-crippled Js)?

    I did run across an xhtml module thingie which I might be able to figure out how it works, but it seems to be made for xhtml 1 and 1.1 (!) neither of which I'm using... so I'm not sure if the whole xml module thingie would even work in html4.

    Advice? I think I'm on the right track with both online forms and pdf's, but the real question is over the anchors. The writer of the current site has
    <A HREF="pdf/pdf.php?pdf=mutatie" TARGET="verzekeren_pdf">Mutatieformulier</A>

    Thanks in advance,
    pOes

  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 have a couple of options:
    1. Use a Transitional doctype declaration on those pages and use the deprecated target attribute.
    2. Use unobtrusive JavaScript to add an event listener for those links, opening a new window when the link is clicked. This won't work if JS is disabled/blocked, but that's no disaster. The user can still use the Back button if the PDF plug-in opens in the browser window.
    Birnam wood is come to Dunsinane


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
  •