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

    javascript e asp assieme problema

    salve,
    ho questo testo scorrevole dove prelievo dei dati da un db ma non mi si visualizza niente neanche un errore dove sbaglio?

    <script language="JavaScript1.2">

    //Specify the marquee's width (in pixels)
    var marqueewidth=150
    //Specify the marquee's height
    var marqueeheight=150
    //Specify the marquee's scroll speed (larger is faster)
    var speed=1
    //Specify the marquee contents

    var marqueecontents='<%
    dim titolo13
    dim rs13
    dim sql13
    titolo13=request.querystring("titolo")
    Set rs13 = Server.CreateObject("ADODB.Recordset")
    sql13="select * from pescare where codcat=1 and titolo='"&replace(titolo13,"'","''")&"'"
    rs13.open sql13, dcnDB, 3, 3
    if not rs13.eof then
    %>

    <%=(rs13("descrizione"))%>

    <%
    end if
    rs13.close
    set rs13=nothing
    %>'




    if (document.all){
    document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheig ht+'">'+marqueecontents+'</marquee>')}
    else if(document.layers){
    document.write('<ilayer id="cmarquee01" width="'+marqueewidth+'" height="'+marqueeheight+'"><layer id="cmarquee02" width="'+marqueewidth+'" height="'+marqueeheight+'"></layer></ilayer>')}

    function regenerate(){
    window.location.reload()
    }
    function regenerate2(){
    if (document.layers){
    setTimeout("window.onresize=regenerate",450)
    intializemarquee()
    }
    }

    function intializemarquee(){
    document.cmarquee01.document.cmarquee02.document.w rite(marqueecontents)
    document.cmarquee01.document.cmarquee02.document.c lose()
    thelength=document.cmarquee01.document.cmarquee02. document.height
    scrollit()
    }

    function scrollit(){
    if (document.cmarquee01.document.cmarquee02.top>=thel ength*(-1)){
    document.cmarquee01.document.cmarquee02.top-=speed
    setTimeout("scrollit()",100)
    }
    else{
    document.cmarquee01.document.cmarquee02.top=marque eheight
    scrollit()
    }
    }

    window.onload=regenerate2
    // -->

  2. #2
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    il js non digerisce gli "a capo" all'interno di una dichiarazione di stringa.

    correggi:

    var marqueecontents='<%
    dim titolo13
    dim rs13
    dim sql13
    titolo13=request.querystring("titolo")
    Set rs13 = Server.CreateObject("ADODB.Recordset")
    sql13="select * from pescare where codcat=1 and titolo='"&replace(titolo13,"'","''")&"'"
    rs13.open sql13, dcnDB, 3, 3
    if not rs13.eof then
    response.write(rs13("descrizione"))
    end if

    rs13.close
    set rs13=nothing
    %>'

    ciao
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

  3. #3
    non funziona ancora però....

  4. #4
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    Esamina il codice che riceve il browser... se serve aiuto posta il link alla pagina.

    ciao
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

  5. #5
    questo è il codice che riceve il mio browser :




    <script language="JavaScript">
    <!--

    function SymError()
    {
    return true;
    }

    window.onerror = SymError;

    var SymRealWinOpen = window.open;

    function SymWinOpen(url, name, attributes)
    {
    return (new Object());
    }

    window.open = SymWinOpen;

    //-->
    </script>

    <script language="JavaScript1.2">

    //Specify the marquee's width (in pixels)
    var marqueewidth=150
    //Specify the marquee's height
    var marqueeheight=150
    //Specify the marquee's scroll speed (larger is faster)
    var speed=1
    //Specify the marquee contents
    var marqueecontents=''





    if (document.all){
    document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheig ht+'">'+marqueecontents+'</marquee>')}
    else if(document.layers){
    document.write('<ilayer id="cmarquee01" width="'+marqueewidth+'" height="'+marqueeheight+'"><layer id="cmarquee02" width="'+marqueewidth+'" height="'+marqueeheight+'"></layer></ilayer>')}

    function regenerate(){
    window.location.reload()
    }
    function regenerate2(){
    if (document.layers){
    setTimeout("window.onresize=regenerate",450)
    intializemarquee()
    }
    }

    function intializemarquee(){
    document.cmarquee01.document.cmarquee02.document.w rite(marqueecontents)
    document.cmarquee01.document.cmarquee02.document.c lose()
    thelength=document.cmarquee01.document.cmarquee02. document.height
    scrollit()
    }

    function scrollit(){
    if (document.cmarquee01.document.cmarquee02.top>=thel ength*(-1)){
    document.cmarquee01.document.cmarquee02.top-=speed
    setTimeout("scrollit()",100)
    }
    else{
    document.cmarquee01.document.cmarquee02.top=marque eheight
    scrollit()
    }
    }

    window.onload=regenerate2
    // -->

    </script>





    la variabile var marqueecontents='' non contiente niente.... come si fa...

  6. #6
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    Se non riceve niente il problema e' nel codice ASP... se vuoi sposto la discussione nel furum giusto.

    ciao
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

  7. #7
    boh il codice asp l'ho sempre usato così mi sembra giusto ok sposta la discussione 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.