Foros del Web » Programando para Internet » Javascript »

multiples script en mi pagina

Estas en el tema de multiples script en mi pagina en el foro de Javascript en Foros del Web. hola amigos tengo un problema con varias funciones con java. al momento de ejecutarlas. este es el 1º script Código PHP: < script type = "text/javascript" ...
  #1 (permalink)  
Antiguo 08/10/2009, 16:32
 
Fecha de Ingreso: enero-2009
Mensajes: 142
Antigüedad: 15 años, 3 meses
Puntos: 0
Pregunta multiples script en mi pagina

hola amigos tengo un problema con varias funciones con java. al momento de ejecutarlas.

este es el 1º script

Código PHP:
<script type="text/javascript">
            $(function (){

                
// Accordion
                
$("#accordion").accordion({ header"h3" });
    
                
// Tabs
                
$('#tabs').tabs();
    

                
// Dialog            
                
$('#dialog').dialog({
                    
autoOpenfalse,
                    
width600,
                    
buttons: {
                        
"Ok": function() { 
                            $(
this).dialog("close"); 
                        }, 
                        
"Cancel": function() { 
                            $(
this).dialog("close"); 
                        } 
                    }
                });
                
                
// Dialog Link
                
$('#dialog_link').click(function(){
                    $(
'#dialog').dialog('open');
                    return 
false;
                });

                
// Datepicker
                
$('#datepicker').datepicker({
                    
inlinetrue
                
});
                
                
// Slider
                
$('#slider').slider({
                    
rangetrue,
                    
values: [1767]
                });
                
                
// Progressbar
                
$("#progressbar").progressbar({
                    
value20 
                
});
                
                
//hover states on the static widgets
                
$('#dialog_link, ul#icons li').hover(
                    function() { $(
this).addClass('ui-state-hover'); }, 
                    function() { $(
this).removeClass('ui-state-hover'); }
                );
                
            });
        
</script> 
ese es uno y el otro esta bien. pero al momento de llamarlos en el body tengo problemas

Código PHP:
<body onload="#accordion(); loadTimers();"
aqui agrego el loadTimers

<script language="javascript" type="text/javascript">

function $(v) {
return document.getElementById(v);
}

var lastIntervalID;

function setFechaHora(s) {
var d = new Date();
var hours = d.getHours();
var mins = d.getMinutes();
var sec = d.getSeconds();
//alert(hours + ":" + mins + ":" + sec);
var value = hours + ":" + mins + ":" + sec;
var obj = $(s);

obj.value = value;
//document.getElementById(
//document.getElementById('recibida').value = value;
//document.getElementById('montada').value = value;
//document.getElementById('procedesde').value = value;
//document.getElementById('procehasta').value = value;
//document.getElementById('recibida2').value = value;
//document.getElementById('montada2').value = value;
//document.getElementById('procdesde').value = value;
//document.getElementById('prochasta').value = value;
//document.getElementById('avisodesde').value = value;
//document.getElementById('avisohasta').value = value;
//document.getElementById('pdf').value = value;


}

function setHiddenValue(c) {

$('_' + c).value = $(c).value;
window.clearInterval($(c).attributes['interval'].value);

}

function loadTimers() {


<?php
if(!$recibida) echo "$('recibida').attributes['interval'].value = window.setInterval('setFechaHora(\'recibida\');', 1000);";
if(!$montada) echo "$('montada').attributes['interval'].value = window.setInterval('setFechaHora(\'montada\');', 1000);";
if(!$procedidesde) echo "$('procedidesde').attributes['interval'].value = window.setInterval('setFechaHora(\'procedidesde\') ;', 1000);";
if(!$procedihasta) echo "$('procedihasta').attributes['interval'].value = window.setInterval('setFechaHora(\'procedihasta\') ;', 1000);";
if(!$recibida2) echo "$('recibida2').attributes['interval'].value = window.setInterval('setFechaHora(\'recibida2\');', 1000);";
if(!$montada2) echo "$('montada2').attributes['interval'].value = window.setInterval('setFechaHora(\'montada2\');', 1000);";
if(!$procdesde) echo "$('procdesde').attributes['interval'].value = window.setInterval('setFechaHora(\'procdesde\');', 1000);";
if(!$prochasta) echo "$('prochasta').attributes['interval'].value = window.setInterval('setFechaHora(\'prochasta\');', 1000);";
if(!$codesde) echo "$('codesde').attributes['interval'].value = window.setInterval('setFechaHora(\'codesde\');', 1000);";
if(!$correccionhasta) echo "$('correccionhasta').attributes['interval'].value = window.setInterval('setFechaHora(\'correccionhasta \');', 1000);";
if(!$coordesde) echo "$('coordesde').attributes['interval'].value = window.setInterval('setFechaHora(\'coordesde\');', 1000);";
if(!$coorhasta) echo "$('coorhasta').attributes['interval'].value = window.setInterval('setFechaHora(\'coorhasta\');', 1000);";
if(!$avisoesperadesde) echo "$('avisoesperadesde').attributes['interval'].value = window.setInterval('setFechaHora(\'avisoesperadesd e\');', 1000);";
if(!$avisoesperahasta) echo "$('avisoesperahasta').attributes['interval'].value = window.setInterval('setFechaHora(\'avisoesperahast a\');', 1000);";
if(!$pdf) echo "$('pdf').attributes['interval'].value = window.setInterval('setFechaHora(\'pdf\');', 1000);";
?>
//$('recibida').attributes['interval'].value = window.setInterval('setFechaHora(\'recibida\');', 1000);
//$('montada').attributes['interval'].value = window.setInterval('setFechaHora(\'montada\');', 1000);
//$('procedesde').attributes['interval'].value = window.setInterval('setFechaHora(\'procedesde\');' , 1000);
//$('procehasta').attributes['interval'].value = window.setInterval('setFechaHora(\'procehasta\');' , 1000);
//$('recibida2').attributes['interval'].value = window.setInterval('setFechaHora(\'recibida2\');', 1000);
//$('montada2').attributes['interval'].value = window.setInterval('setFechaHora(\'montada2\');', 1000);
//$('procdesde').attributes['interval'].value = window.setInterval('setFechaHora(\'procdesde\');', 1000);
//$('prochasta').attributes['interval'].value = window.setInterval('setFechaHora(\'prochasta\');', 1000);
//$('avisodesde').attributes['interval'].value = window.setInterval('setFechaHora(\'avisodesde\');' , 1000);
//$('avisohasta').attributes['interval'].value = window.setInterval('setFechaHora(\'avisohasta\');' , 1000);
//$('pdf').attributes['interval'].value = window.setInterval('setFechaHora(\'pdf\');', 1000);
}
function tiempo1(){
alert("Su Tiempo ha Terminado, debe terminar el Montaje y comenzar Edición");
}
function tiempo2(){
alert("Su Tiempo ha Terminado, debe terminar la Edición y comenzar Corrección");
}
function tiempo3(){
alert("Su Tiempo ha Terminado, debe terminar Corrección y comenzar Coordinador");
}
function tiempo4(){
alert("Su Tiempo ha Terminado, debe terminar Coordinador y comenzar Tiempo de Espera");
}
function tiempo5(){
alert("Su Tiempo ha Terminado, debe terminar El Tiempo de Espera y comenzar PDF");
}
function tiempo6(){
alert("Su Tiempo ha Terminado, debe terminar el Montaje y comenzar Edición");
}
function tiempo7(){
alert("Su Tiempo ha Terminado, debe terminar la Edición y comenzar Corrección");
}
timeout = {
'id' : 0,
'iniciar': function(funcion_a_ejecutar, tiempo) {
timeout.id = setTimeout(funcion_a_ejecutar, tiempo);
},
'detener' : function() {
window.clearTimeout(timeout.id);
},
}
</script>



alguien me puede ayudar por favor.

Última edición por juansiruiz; 09/10/2009 a las 08:51
  #2 (permalink)  
Antiguo 08/10/2009, 17:16
Avatar de deirdre  
Fecha de Ingreso: mayo-2009
Mensajes: 690
Antigüedad: 15 años
Puntos: 45
Respuesta: multiples script en mi pagina

Muestras tus códigos pacialmente, pero no dices nada sobre cuál es (o son) el problema. No muestras nada sobre 'loadTimers()'.

Yo creo que es imposible ayudar formulando la pregunta de esa forma.

Es muy bonito no confundir Java con javascript, son cosas totalmente diferentes.

Bye
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 13:33.