Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2004
    Messaggi
    444

    [XHTML] L'attributo TARGET nn esiste?!

    Sto cercando di validare la mia index per XHTML, solo che mi dà questo errore

    Error Line 32, column 79: there is no attribute "target" .
    ...****" target="_blank">My Blog</a></div>
    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.

    Il mio doctype è

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    cosa può essere?
    *********************************
    Andrea
    *********************************

  2. #2
    In XHTML 1.0 Strict l'attributo target è stato deprecato. Le motivazioni? Principalmente per motivi di accessibilità. Prova a leggere qui (punto 10.1):

    - http://www.aib.it/aib/cwai/WAI-trad....-accessibility


  3. #3
    Qui trovi la soluzione al problema utilizzando Javascript...

    Essere è la condizione
    Vivere il dolore

  4. #4
    Ehm, quello è più che altro un aggiramento del problema.

    Occorre prima comprendere le motivazioni che stanno alla base della deprecazione (si scrive così? ) e ricercarle nell'accessibilità.

    Leggendo il checkpoint che ho citato sopra, una buona soluzione sarebbe avvisare l'utente che, cliccando sul link, esso verrà aperto in una nuova finestra browser.

    Ma, come dice l'articolo, meglio non abusare.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.