Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    problema di validazione per "target"

    nel validatore w3c html mi dice che target non lo posso usare, mentre a me serve perchè linko a dei siti che dovrebbero farmi aprire un'altra finestra (non voglio che si esca dal mio sito).
    Allego testo di messaggio; tra l'altro funziona tutto bene nella decina di browsers che ho.
    Grazie.


    ************************************************** *******

    there is no attribute "target".

    [*]Giornali da tutto il mondo



    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. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

  2. #2
    Moderatrice di Grafica, Cerco e offro lavoro L'avatar di Myaku
    Registrato dal
    Nov 2006
    Messaggi
    10,349
    stai usando una dtd strict? in questo caso, devi passare ad una transitional per ottenere la validazione, o in alternativa usare javascript per forzare l'apertura in una nuova finestra.


  3. #3
    Ciao, scusate se riapro una vecchia discussione...

    o in alternativa usare javascript per forzare l'apertura in una nuova finestra.
    Potresti farmi un'esempio? Anche sul come richiamare la funzione JS da <a href>

    Grazie!


  4. #4
    Più che altro dovresti prima chiederti il perchè. Ti do qualche informazione di carattere generale.

    L'apertura non richiesta dall'utente di nuove finestre è considerata una tecnica invasiva. Da qui, le DTD più moderne (le varie strict e XHTML 1.1) non consentono l'utilizzo di target.

    Forzare l'apertura tramite javascript è sbagliato per due motivi: il primo è che violi il concetto di cui sopra, il secondo è che gli utenti con javascript disabilitato o senza il supporto javascript non riusciranno ad aprire i link.

    Quindi, se proprio vuoi aprire una nuova finestra, utilizza una DTD transitional e l'attributo target.

    Il mio consiglio invece è quello di mantenerti su una DTD strict e informare gli utenti del tuo sito (sulla pagina dell'accessibilità ad esempio, o con delle informazioni in una parte del tuo sito) che se vogliono possono aprire i link in una nuova pagina tenendo premuto SHIFT oppure in una nuova scheda tenendo premuto CTRL.

    Lascia all'utente la libertà di scegliere.
    Sgro - Webmaster, programmazione c# e progettazione database.
    Non si forniscono soluzioni in privato.
    Non si fornisce la "pappa pronta".

  5. #5
    Un punto di vista interessante... Anche se personalmente non credo che l'utente medio abbia voglia/sia in grado di leggersi pure le istruzioni per aprire un link. Comunque seguirò il tuo consiglio, visto che così voglio i Sacri Dettami del W3C

    Grazie

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.