Visualizzazione dei risultati da 1 a 9 su 9
  1. #1
    Utente di HTML.it L'avatar di bagu
    Registrato dal
    Mar 2003
    Messaggi
    620

    validazione xhtml 1.1 e name

    [img]immagini/bannerblu.jpg[/img]</a>
    se metto solo id viene validato lo javascript va solo con firefox
    il w3c dice :
    1.

    Line 77, column 66: there is no attribute "name"

    ...ini/bannerblu.jpg" alt="banner1" id="banner1" name="banner1"/></a>

    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.


    ho cercato nei vari forum , html programmazione xhtml ma nulla ....qualcuno ha soluzioni o suggerimenti ?
    grazie
    paolo
    Non so se Dio esiste ma se non esiste ci fa una figura migliore!
    - S. Benni -

  2. #2
    Utente di HTML.it L'avatar di zoom
    Registrato dal
    Dec 2001
    Messaggi
    1,737
    l'attributo name non esiste.
    devi usare id


    il js non sarà impostato per usare l'id...
    correggilo e vedrai che funziona con tutti i browser
    Chicco Ravaglia per sempre con noi!

  3. #3
    Utente di HTML.it L'avatar di bagu
    Registrato dal
    Mar 2003
    Messaggi
    620
    ehm....ehm....
    conoscenze js=0

    questo è lo script:
    <script type="text/javascript">
    <!--
    /* Banner Up! - Copyright 1999-2000 By Heidi Allen
    Knowledge Hound: The How-To Hunter - Learn how to do almost anything...for free!
    Please visit us at http://www.knowledgehound.com
    License for use of this script is granted if and only if
    this entire copyright notice is included with it. We do not provide
    support for this script. It is provided solely as a friendly gesture.
    Use at your own risk. Thanks! */
    // Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
    var image="";
    var banners=0;
    function cycle() {
    if (++banners > 3) banners=1;
    loadbanners();
    document.banner1.src = image;
    window.setTimeout('cycle();',5000);
    }
    function loadbanners() {
    if (banners==1)
    {
    image="immagini/banner.jpg";
    }
    if (banners==2)
    {
    image="immagini/bannertrasp.gif";
    }
    if (banners==3)
    {
    image="immagini/bannerblu.jpg";
    }
    }
    //-->
    </script>
    <script type="text/javascript">
    <!--
    var link = "#"
    function urlswitch() {
    if (banners==1)
    {
    link = "#";
    }
    if (banners==2)
    {
    link = "#";
    }
    if (banners==3)
    {
    link = "#";
    }
    return link;
    }
    //-->
    </script>

    e l'html:

    <body onload="window.setTimeout('cycle();',5000);(loadba nners());(urlswitch());">
    <div id="container">
    <div id="banner">
    <div id="imagebanner"><a href="#" onclick="this.href=urlswitch()">
    [img]immagini/bannerblu.jpg[/img]</a>
    </div>


    cosi' alla prima occhiata è difficile da modificare ?
    o avete qualcosa di pronto da poter utilizzare in alternativa ?
    In effetti randomizare la scelta del banner farebbe di piu' al caso mio
    ciao e grazie
    paolo
    Non so se Dio esiste ma se non esiste ci fa una figura migliore!
    - S. Benni -

  4. #4
    Utente di HTML.it L'avatar di zoom
    Registrato dal
    Dec 2001
    Messaggi
    1,737
    così a occhio..
    prova a fare così:

    al posto di
    codice:
     loadbanners();
    document.banner1.src = image;
    window.setTimeout('cycle();',5000);
    metti
    codice:
     loadbanners();
    document.getElementById("banner1").src = image;
    window.setTimeout('cycle();',5000);

    però così funziona solo con browser piuttosto recenti...
    l'ideale sarebbe una cosa del tipo...
    codice:
     loadbanners();
    if (document.getElementById){
    document.getElementById("banner1").src = image;
    }
    else if(document.all){
    document.all.banner1.src = image;
    }
    else if(document.layers){
    document.layers["banner1"].src = image;
    }
    window.setTimeout('cycle();',5000);
    ma non ho idea se funziona..
    l'ho buttato giù di corsa...
    Chicco Ravaglia per sempre con noi!

  5. #5
    Utente di HTML.it L'avatar di bagu
    Registrato dal
    Mar 2003
    Messaggi
    620
    grassie ora provo e domani ti fo sapere

    ciao
    paolo
    Non so se Dio esiste ma se non esiste ci fa una figura migliore!
    - S. Benni -

  6. #6
    Utente di HTML.it L'avatar di bagu
    Registrato dal
    Mar 2003
    Messaggi
    620
    metti

    code: loadbanners();
    document.getElementById("banner1").src = image;
    window.setTimeout('cycle();',5000);

    funziona , grazie e mille
    paolo
    Non so se Dio esiste ma se non esiste ci fa una figura migliore!
    - S. Benni -

  7. #7
    Utente di HTML.it L'avatar di zoom
    Registrato dal
    Dec 2001
    Messaggi
    1,737
    di niente...
    ti ricordo però che getElementById è supportato solo da browser recenti
    per farlo funzionare con tutti devi mettere tutti i casi...
    Chicco Ravaglia per sempre con noi!

  8. #8
    Utente di HTML.it L'avatar di bagu
    Registrato dal
    Mar 2003
    Messaggi
    620
    va con ie 5 firefox safari 1.0 e opera 7 penso possa essere sufficiente

    ciao
    paolo
    Non so se Dio esiste ma se non esiste ci fa una figura migliore!
    - S. Benni -

  9. #9
    Utente di HTML.it L'avatar di zoom
    Registrato dal
    Dec 2001
    Messaggi
    1,737
    si per recenti intendo di nuova generazione...
    mi pare da dopo il 4 sia supportato...
    document.all rimane per IE 4
    document.layers per NS 4....
    cmq ormai può bastare anche quello...


    Chicco Ravaglia per sempre con noi!

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 © 2024 vBulletin Solutions, Inc. All rights reserved.