Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2003
    Messaggi
    8

    problemi con javascript

    Ciao a tutti,
    volevo sottoporvi quello ke per me sta diventando un rompicapo:
    devo inserire un javascript ke regola un countdown, ma non riesco a farlo funzionare.
    Il codice mi è stato fornito dal cliente e la funzione è -function getTime-
    DOMANI HO LA CONSEGNA... e sto per diventare celestina.

    aiutoooooo.......!!!!!!

    --------------

    <html>
    <head>
    <title>BIT</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="notizie.css" type="text/css">
    <script language="JavaScript">
    <!--
    function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }

    function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }

    function MM_findObj(n, d) { //v4.0
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && document.getElementById) x=document.getElementById(n); return x;
    }

    function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }

    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
    }
    function getTime() {
    now = new Date();
    y2k = new Date("Jun 08 2003 20:30:00");
    days = (y2k - now) / 1000 / 60 / 60 / 24;
    daysRound = Math.floor(days);
    hours = (y2k - now) / 1000 / 60 / 60 - (24 * daysRound);
    hoursRound = Math.floor(hours);
    minutes = (y2k - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
    minutesRound = Math.floor(minutes);
    seconds = (y2k - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
    secondsRound = Math.round(seconds);
    sec = (secondsRound == 1) ? " secondo" : " secondi";
    min = (minutesRound == 1) ? " minuto" : " minuti, ";
    hr = (hoursRound == 1) ? " ora" : " ore, ";
    dy = (daysRound == 1) ? " giorno" : " giorni, "
    document.timeForm.input1.value = "Mancano " + daysRound + dy + hoursRound + hr + minutesRound + min + secondsRound + sec + " al concerto di Firenze!";
    newtime = window.setTimeout("getTime();", 1000);
    }
    //-->
    </script>
    <link rel="stylesheet" href="notizie.css" type="text/css">
    </head>
    <meta name="keywords" content="musica,concerti,artista,toscana box office ,firenze ,musica dal vivo, live,prevendite,biglietti,grignani ,caposella,tori amos,bruce springseen,ligabue,paola turci,carmen consoli,teatro tenda ,saschall,verdi,palasport,calendario,cantanti,cant autori,spettacoli,prg ">
    <body bgcolor="#A19E9E" text="#000000" onLoad="MM_preloadImages('immagini/not2.gif','immagini/cal2.gif','immagini/pre2.gif','immagini/luo2.gif','immagini/fo2.gif')">
    <table width="700" bgcolor="#FFFFFF" align="center" cellspacing="0" cellpadding="0" border="0">
    <tr>
    <td>[img]immagini/up.gif[/img]</td>
    </tr>
    <tr>
    <td height="373">
    <table width="700" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="10"></td>
    <td width="230" align="center">[img]immagini/bit_main.jpg[/img]



    [img]immagini/bohome.gif[/img]

    </td>
    <td width="20"></td>
    <td>[img]immagini/boss_home%20copia.jpg[/img]</td>
    <td width="10"></td>
    </tr>
    <tr>
    <td colspan="5" height="50"><FORM name=timeForm>
    <P align=center><INPUT
    style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; FONT: 14px arial, helvetica,sans-serif; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid"
    type=texte size=71 name=input1 border-style="none"> </FORM></td>
    </tr>
    <tr>
    <td colspan="5" align="center" valign="middle">
    [img]immagini/riga2.gif[/img]</td>
    </tr>

  2. #2
    Utente di HTML.it
    Registrato dal
    Dec 2001
    Messaggi
    3,259
    se cambiamo due righe si inca++ano?

    codice:
    <html>
    <head> 
    <title>BIT</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    <link rel="stylesheet" href="notizie.css" type="text/css"> 
    <script language="JavaScript"> 
    <!-- 
    function MM_swapImgRestore() { //v3.0 
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; 
    } 
    
    function MM_preloadImages() { //v3.0 
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); 
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) 
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} 
    } 
    
    function MM_findObj(n, d) { //v4.0 
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { 
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} 
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; 
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); 
    if(!x && document.getElementById) x=document.getElementById(n); return x; 
    } 
    
    function MM_swapImage() { //v3.0 
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) 
    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} 
    } 
    
    function MM_openBrWindow(theURL,winName,features)
    { //v2.0 
    window.open(theURL,winName,features); 
    } 
    function data() { 
    now = new Date(); 
    y2k = new Date("Jun 08 2003 20:30:00"); 
    days = (y2k - now) / 1000 / 60 / 60 / 24; 
    daysRound = Math.floor(days); 
    hours = (y2k - now) / 1000 / 60 / 60 - (24 * daysRound); 
    hoursRound = Math.floor(hours); 
    minutes = (y2k - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound); 
    minutesRound = Math.floor(minutes); 
    seconds = (y2k - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound); 
    secondsRound = Math.round(seconds); 
    sec = (secondsRound == 1) ? " secondo" : " secondi"; 
    min = (minutesRound == 1) ? " minuto" : " minuti, "; 
    hr = (hoursRound == 1) ? " ora" : " ore, "; 
    dy = (daysRound == 1) ? " giorno" : " giorni, " 
    document.timeForm.input1.value="Mancano " + daysRound + dy + hoursRound + hr + minutesRound + min + secondsRound + sec + " al concerto di Firenze!";
    } 
    //--> 
    </script> 
    <link rel="stylesheet" href="notizie.css" type="text/css"> 
    </head> 
    <meta name="keywords" content="musica,concerti,artista,toscana box office ,firenze ,musica dal vivo, live,prevendite,biglietti,grignani ,caposella,tori amos,bruce springseen,ligabue,paola turci,carmen consoli,teatro tenda ,saschall,verdi,palasport,calendario,can
    tanti,cantautori,spettacoli,prg ">
    <body bgcolor="#A19E9E" text="#000000" onLoad="setInterval('data()','1000');MM_preloadImages('immagini/not2.gif','immagini/cal2.gif','immagini/pre2.gif','immagini/luo2.gif','immagini/fo2.gif')"> 
    <table width="700" bgcolor="#FFFFFF" align="center" cellspacing="0" cellpadding="0" border="0"> 
    <tr> 
    <td>[img]immagini/up.gif[/img]</td> 
    </tr> 
    <tr> 
    <td height="373"> 
    <table width="700" border="0" cellspacing="0" cellpadding="0"> 
    <tr> 
    <td width="10"> </td> 
    <td width="230" align="center">[img]immagini/bit_main.jpg[/img]
    
    
     
    [img]immagini/bohome.gif[/img]
     
    </td>
    <td width="20"> </td> 
    <td>[img]immagini/boss_home%20copia.jpg[/img]</td>
    <td width="10"> </td>
    </tr> 
    <tr> 
    <td colspan="5" height="50"><FORM name=timeForm>
    <P align=center><INPUT style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; FONT: 14px arial, helvetica,sans-serif; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid" type=text size=71 name=input1 border-style="none"> </FORM></td>
    </tr> 
    <tr>
    <td colspan="5" align="center" valign="middle"> 
    [img]immagini/riga2.gif[/img]</td>
    </tr>

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2003
    Messaggi
    8
    Grazie 1000

    sei stato gentilissimo!!!!

    domani con calma poi vorrei tentare di capire il tutto... ora ho solo un sonno pazzesco

    a presto

    -assu-

  4. #4
    Utente di HTML.it
    Registrato dal
    Dec 2001
    Messaggi
    3,259
    Originariamente inviato da aTNu
    Grazie 1000

    sei stato gentilissimo!!!!

    domani con calma poi vorrei tentare di capire il tutto... ora ho solo un sonno pazzesco

    a presto

    -assu-
    ciao!

    guarda che ho proprio cambiato due righe...

    comunque, se ti serve,

    chiedi!

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.