Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/09/2007, 10:09
Avatar de rockobop
rockobop
 
Fecha de Ingreso: octubre-2004
Ubicación: Bolivia
Mensajes: 826
Antigüedad: 20 años, 4 meses
Puntos: 1
problemas con dos scripts en una misma pagina

hola maestros

Ya intente de todo y pues no consegui hacer funcionar q dos scripts uno q me muestra la hora y otro q me muestra un sencillo calendario me funcionaran en la misma pagina. LA idea q manejaba es q se me mostraran en distintos paneles pero no consegui ni haciendolos funcionar en un solo panel

aqui les dejo el codigo html y de los javascripts

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  <meta name="description" content="Your description goes here" />
  <link rel="stylesheet" type="text/css" href="andreas00.css" media="screen,projection" />
  <title>MArmolera  v.20</title>
</head>

<div id="contenedor">

        <div id="barizquierda">
                            
                            <div id="miCalendario">
                            <body  onLoad="tunCalendario()">    
                            <script language="JavaScript" type="text/javascript">
                            var idContenedor = "miCalendario"
                            var hoy = new Date()
                            var mes = hoy.getMonth()
                            var dia = 1
                            var anio = hoy.getFullYear()
                            var diasSemana = new Array ('L','M','M','J','V','S','D')
                            var meses = new Array('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre')
                            var tunIex=navigator.appName=="Microsoft Internet Explorer"?true:false;
                            if(tunIex && navigator.userAgent.indexOf('Opera')>=0){tunIex = false}
                            tunOp = navigator.userAgent.indexOf('Opera')>=0 ? true: false;
                            function tunCalendario(){
                                dia2 = dia
                                tab = document.createElement('table')
                                tab.id = 'calendario'
                                document.getElementById(idContenedor).appendChild(tab)
                                tcabeza = document.createElement('thead')
                                tab.appendChild(tcabeza)
                                fi2 = document.createElement('tr')
                                fi2b = document.createElement('th')
                                fi2b.colSpan = 7
                                fi2.id = 'mesCalendario'
                                fi2b.appendChild(document.createTextNode(meses[mes] + "  -  " + anio))
                                fi2.appendChild(fi2b)
                                tcabeza.appendChild(fi2)
                                fi = document.createElement('tr')
                                tcabeza.appendChild(fi)
                                for(m=0;m<7;m++){
                                    ce = document.createElement('th')
                                    ce.appendChild(document.createTextNode(diasSemana[m]))
                                    fi.appendChild(ce)
                                }
                                var escribe = false
                                var escribe2 = true
                                fecha = new Date(anio,mes,dia)
                                var d = fecha.getDay()-1 //dia semana
                                if(d<0){d = 6}
                                tcuerpo = document.createElement('tbody')
                                tab.appendChild(tcuerpo)
                                while(escribe2){
                                    fi = document.createElement('tr')
                                    co = 0
                                    for(t=0;t<7;t++){
                                        ce = document.createElement('td')
                                        if(escribe && escribe2){
                                        fecha2 = new Date(anio,mes,dia)
                                        
                                        if(fecha2.getMonth() != mes){escribe2 = false;}
                                        else{ce.appendChild(document.createTextNode(dia));dia++;co++}
                                    }
                                    if(d == t && !escribe){
                                    ce.appendChild(document.createTextNode(dia))
                                    dia++;co++
                                    escribe = true
                                    }
                                    fi.appendChild(ce)
                                    if(hoy.getDate()+1 == dia && mes == hoy.getMonth() && anio == hoy.getFullYear()){ce.className = "Hoy"}
                                }
                                        
                                    if(co>0){tcuerpo.appendChild(fi)}
                                    
                                }
                                dia = dia2
                            }
                            </script>
                    </body>        
                    </div>        
                    
                    
                    <h2 class="hide"></h2>
                        <ul class="avmenu" class="current">
                            <li><a href="index.html">Inicio</a></li>
                            <li><a href="styles.html">Informacion</a></li>
                            <li><a href="2-columns.html">Clientes</a></li>
                            <li><a href="3-columns.html">Nuestro Trabajo</a></li>
                            <li><a href="themes.html">Album de Fotos</a></li>
                            <li><a href="themes.html">Contacto</a></li>
                        </ul>
                    
                                
                <span id="extras">
                
                    <body onLoad="show5()">
                        <script language="JavaScript">
                                <!--
                                function show5(){
                                if (!document.layers&&!document.all&&!document.getElementById)
                                return
                                var Digital=new Date()
                                var hours=Digital.getHours()
                                var minutes=Digital.getMinutes()
                                var seconds=Digital.getSeconds()
                                var dn="AM" 
                                if (hours>12){
                                dn="PM"
                                hours=hours-12
                                }
                                if (hours==0)
                                hours=12
                                if (minutes<=9)
                                minutes="0"+minutes
                                if (seconds<=9)
                                seconds="0"+seconds
                                //change font size here to your desire
                                myclock="<font size='5' face='Arial' ><h2>Hora Actual:<br></br>"+hours+":"+minutes+":"
                                +seconds+" "+dn+"</h2></br>"
                                if (document.layers){
                                document.layers.liveclock.document.write(myclock)
                                document.layers.liveclock.document.close()
                                }
                                else if (document.all)
                                liveclock.innerHTML=myclock
                                else if (document.getElementById)
                                document.getElementById("hora").innerHTML=myclock
                                setTimeout("show5()",1000)
                                }
                                //-->
                        </script>
                    </body>
                    </span>    
                                
            </div>
       
  <div id="content">
        <h2>noticias del cuerpo</h2>
        <p>cuerpo centra de la pagina </p>
        
        <p>mas notas del cuerpo central</p>

       
    </div>

</div>
</body>
</html>
</div> 
el texto css se los dejo en otro post por q este ya se hizo muy largo

saludos
__________________
:pensando: Tú no necesitas un libro mágico, un gurú carismático, rituales primitivos. Sólo necesitas tus cinco sentidos.:adios: