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

    Inserire più JavaScript in una pagina

    Ciao ragazzi, come posso fare per inserire più volte lo stesso JavaScript in una pagina web html?

    Io ho provato ma ho avuto risultati negativi.
    Vi posto il codice.
    codice:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml">
    
    <head>
    <meta http-equiv="Content-Language" content="it" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Nolimit Shell</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <style type="text/css">
    .style1 {
    	text-align: center;
    }
    .style2 {
    	border: 2px solid #FFFFFF;
    }
    .style3 {
    	border: 1px solid #FFFFFF;
    }
    .style4 {
    	border: 1px solid #FFFFFF;
    	color: #CCCCCC;
    }
    </style>
    </head>
    
    <body>
    
    <p class="style1">[img]images/logo.jpg[/img]</p>
    <p class="style1"></p>
    <p class="style1"></p>
    <div align="center">
    <table cellspacing="1" cellpadding="0" class="style2" style="width: 664px; height: 83px" >
    	<tr>
    		<td class="style4">Nome Prodotto</td>
    		<td class="style4">Tipo Prodotto</td>
    		<td class="style4">Time Up</td>
    		<td class="style4">Locazione Server</td>
    		<td class="style4">Locazione Canale</td>
    		<td class="style4">Banda Passante</td>
    	</tr>
    	<tr>
    		<td class="style4">01.nolimit-shell.com</td>
    		<td class="style4">Dedicato</td>
    		<td class="style4">[b]<script language="JavaScript1.2" type="text/javascript">
    function setcountup(theyear,themonth,theday){
    yr=theyear;mo=themonth;da=theday
    }
    
    setcountup(2009,3,27)
    
    var displaymessage=""
    
    var countupwidth='95%'
    var countupheight='20px' //applicable only in NS4
    var countupbgcolor='trasparent'
    var opentags='<font face="Verdana">'
    var closetags='<\/font>'
    
    var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
    var crosscount=''
    
    function start_countup(){
    if (document.layers)
    document.countupnsmain.visibility="show"
    else if (document.all||document.getElementById)
    crosscount=document.getElementById&&!document.all?document.getElementById("countupie") : countupie
    countup()
    }
    
    if (document.all||document.getElementById)
    document.write('<span id="countupie" style="width:'+countupwidth+'; background-color:'+countupbgcolor+'"><\/span>')
    
    window.onload=start_countup
    
    function countup(){
    var today=new Date()
    var todayy=today.getYear()
    if (todayy < 1000)
    todayy+=1900
    var todaym=today.getMonth()
    var todayd=today.getDate()
    var todayh=today.getHours()
    var todaymin=today.getMinutes()
    var todaysec=today.getSeconds()
    var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
    paststring=montharray[mo-1]+" "+da+", "+yr
    dd=Date.parse(todaystring)-Date.parse(paststring)
    dday=Math.floor(dd/(60*60*1000*24)*1)
    dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
    dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
    dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
    
    if (document.layers){
    document.countupnsmain.document.countupnssub.document.write("[b]"+dday+ "<\/strong> gg, [b]"+dhour+"<\/strong> h, "+dmin+" m, e "+dsec+" s "+displaymessage+closetags)
    document.countupnsmain.document.countupnssub.document.close()
    }
    else if (document.all||document.getElementById)
    crosscount.innerHTML="[b]"+dday+ "<\/strong>gg [b]"+dhour+"<\/strong> h"
    
    setTimeout("countup()",1000)
    }
    </script></td>
    		<td class="style4">irc.eden-irc.net</td>
    		<td class="style4">#N0L1M1T</td>
    		<td class="style4">100Mbs</td>
    	</tr>
    	<tr>
    		<td class="style4">02.nolimit-shell.com</td>
    		<td class="style4">Dedicato</td>
    		<td class="style4">[b]<script language="JavaScript1.2" type="text/javascript">
    function setcountup(theyear,themonth,theday){
    yr=theyear;mo=themonth;da=theday
    }
    
    setcountup(2009,3,27)
    
    var displaymessage=""
    
    var countupwidth='95%'
    var countupheight='20px' //applicable only in NS4
    var countupbgcolor='trasparent'
    var opentags='<font face="Verdana">'
    var closetags='<\/font>'
    
    var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
    var crosscount=''
    
    function start_countup(){
    if (document.layers)
    document.countupnsmain.visibility="show"
    else if (document.all||document.getElementById)
    crosscount=document.getElementById&&!document.all?document.getElementById("countupie") : countupie
    countup()
    }
    
    if (document.all||document.getElementById)
    document.write('<span id="countupie" style="width:'+countupwidth+'; background-color:'+countupbgcolor+'"><\/span>')
    
    window.onload=start_countup
    
    function countup(){
    var today=new Date()
    var todayy=today.getYear()
    if (todayy < 1000)
    todayy+=1900
    var todaym=today.getMonth()
    var todayd=today.getDate()
    var todayh=today.getHours()
    var todaymin=today.getMinutes()
    var todaysec=today.getSeconds()
    var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
    paststring=montharray[mo-1]+" "+da+", "+yr
    dd=Date.parse(todaystring)-Date.parse(paststring)
    dday=Math.floor(dd/(60*60*1000*24)*1)
    dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
    dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
    dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
    
    if (document.layers){
    document.countupnsmain.document.countupnssub.document.write("[b]"+dday+ "<\/strong> gg, [b]"+dhour+"<\/strong> h, "+dmin+" m, e "+dsec+" s "+displaymessage+closetags)
    document.countupnsmain.document.countupnssub.document.close()
    }
    else if (document.all||document.getElementById)
    crosscount.innerHTML="[b]"+dday+ "<\/strong>gg [b]"+dhour+"<\/strong>h"
    
    setTimeout("countup()",1000)
    }
    </script></td>
    		<td class="style4">irc.eden-irc.net</td>
    		<td class="style4">#N0L1M1T</td>
    		<td class="style4">100Mbs</td>
    	</tr>
    
    </table>
    </div>
    </body>
    
    </html>
    Come vedete ho inserito due volte lo stesso javascript, ma pubblicando questa pagina web, le celle contenenti i 2 js risultano essere vuote. Come posso fare?
    E poi un'altra cosa, provate ad aprire la pagina sia con IE e sia con Firefox. Il risultato cambia.
    Ecco la pagina pubblicata: www.nolimit-shell.com/dedicati_up.html
    Spero di essere stato chiaro..

  2. #2
    E' perchè ci sono le stesse variabili vero?
    Come posso rimediare?

  3. #3
    Ragazzi per favore è importante!! Altrimenti non avrei scritto qui!!

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.