Visualizzazione dei risultati da 1 a 8 su 8

Discussione: scrolling news

  1. #1

    scrolling news

    ho il seguente script che mi funziona correttamente, ma nel momento in cui faccio un nuovo inserimento in data base non va più, mi da un errore

    linea: 30
    carattere:89
    Errore: previsto ";"
    codice: 0


    sapete dirmi qualcosa?


    <html>
    <head>
    <title>Scrolling news</title>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" type="text/css" href="../../../../Inetpub/pagine/stadioradionew/style.css">
    <link rel="stylesheet" type="text/css" href="public/pagine/stadioradionew/style.css">
    </head>

    <BODY bgcolor="#006699" topmargin="0" leftmargin="0">
    <%
    cString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/public/news/database.mdb")

    'set connession to database
    Set objConn=Server.CreateObject("ADODB.Connection")

    'open connession to database
    objConn.Open cstring

    Set rs = Server.CreateObject("ADODB.Recordset")

    nometabella="news" ' inserisci qui il nome della tabella da vedere

    SQL = "SELECT TOP 6 * FROM "&nometabella&" ORDER BY id DESC"

    'apro il rs
    rs.Open sql, objConn
    stringa = ""
    do until rs.eof

    For Each campo in rs.Fields
    if not (campo.name = "id" or campo.name = "descrizione" or campo.name = "click") then 'non stampa i campi non richiesti
    stringa = stringa & campo &""
    end if
    next

    rs.movenext
    loop
    %>

    <div align="center" style="width: 345; height: 41">
    <center>
    <table border="1" cellpadding="0" cellspacing="0" style="border-style:ridge; border-width:2; border-collapse: collapse" id="AutoNumber1" width="100%" align="left" height="27">
    <tr>
    <td bgcolor="#006699" width="100%" height="14">
    <p align="right"><font color="#FFFFFF">
    <span style="background-color: #006699">

    <script language="JavaScript1.2">
    //Specify the marquee's width (in pixels)
    var marqueewidth=500
    //Specify the marquee's height (in pixels, pertains only to NS)
    var marqueeheight=20
    //Specify the marquee's scroll speed (larger is faster)
    var speed=4
    //Specify the marquee contents
    var marqueecontents='<font face="Arial"><%=stringa%></font>'

    if (document.all)
    document.write('<center><marquee scrollAmount='+speed+' style="width:'+marqueewidth+'">'+marqueecontents+' </marquee></center>')

    function regenerate(){
    window.location.reload()
    }

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

    function intializemarquee(){
    document.cmarquee01.document.cmarquee02.document.w rite('<nobr>'+marqueecontents+'</nobr>')
    document.cmarquee01.document.cmarquee02.document.c lose()
    thelength=document.cmarquee01.document.cmarquee01. document.width
    scrollit()
    }

    function scrollit(){
    if (document.cmarquee01.document.cmarquee02.left>=the length*(-2)){
    document.cmarquee01.document.cmarquee02.left-=speed
    setTimeout("scrollit()",300)
    }
    else{
    document.cmarquee01.document.cmarquee02.left=marqu eewidth
    scrollit()
    }
    }

    window.onload=regenerate2
    </script>


    </span>





    <ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01">
    </ilayer>

    <font color="#FFFFFF" size="0" face="Verdana">
    <span style="background-color: #006699">
    </span>
    </font>
    </font></td>
    </tr>
    <tr>
    <td bgcolor="#006699" width="100%" height="12">

    <p align="left">

    <font color="#FFFFFF" size="0" face="Verdana">
    <span style="background-color: #006699"><font size="1">le newsdi
    </font> </span></font><font color="#70B9FD" size="0" face="Verdana"><span style="background-color: #006699">
    <font size="1">stadioradio</font></span></font>
    </td>
    </tr>
    </table>


    </center>
    </div>


    <ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01">
    <layer name="cmarquee02"></layer>
    </ilayer>

    <%
    rs.close
    set rs=nothing



    %>

    </body>
    </html>
    e vai!!

  2. #2
    si tratta di un errore di asp o di javascript ???
    La riga 30 e` questa : do until rs.eof, ma non ci vedo nulla di male, neanche con la query associata al rs.

    Ciau!
    / Atari

  3. #3
    non penso sia di asp se faccio dei response.write e se elimino il java funziona tutto correttamente e sempre.......non so che dire l'altro indizio che posso dare e che ho provato a creare un nuovo db con le stesse caratteristiche, contenuti e nome e poi mi funziona, secondo me il problema sta nel data base ma non so quale, forse va fatto qualcosa di particolare sullo stesso, visto che viene utilizzato da diversi script, be non so.........
    e vai!!

  4. #4

  5. #5
    il problema mi sa che è su JavaScript



    ho un'applet che mi fa scorrere il testo in modo diverso e funziona anche dopo aver iserito delle news,


    e vai!!

  6. #6
    La linea 30 é questa

    For Each campo in rs.Fields

  7. #7
    forse il riferimento alla linea 30 è relativa a java, contanto solo le righe di java arrivo a

    function intializemarquee(){
    document.cmarquee01.document.cmarquee02.document.w rite('<nobr>'+marqueecontents+'</nobr>')
    document.cmarquee01.document.cmarquee02.document.c lose()
    thelength=document.cmarquee01.document.cmarquee01. document.width
    scrollit()


    forse ho detto una fesseria bo ci ho provato!
    e vai!!

  8. #8

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