Foros del Web » Programando para Internet » Javascript »

Codigo javascritp no funciona en IE

Estas en el tema de Codigo javascritp no funciona en IE en el foro de Javascript en Foros del Web. Hola tengo el siguiente codigo: @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código Javascript : Ver original function padNmb ( nStr , nLen ) {     var sRes = ...
  #1 (permalink)  
Antiguo 05/04/2011, 08:06
 
Fecha de Ingreso: septiembre-2010
Ubicación: Santiago, Chile
Mensajes: 47
Antigüedad: 13 años, 7 meses
Puntos: 0
Codigo javascritp no funciona en IE

Hola tengo el siguiente codigo:

Código Javascript:
Ver original
  1. function padNmb(nStr, nLen){
  2.     var sRes = String(nStr);
  3.     var sCeros = "0000000000";
  4.     return sCeros.substr(0, nLen - sRes.length) + sRes;
  5.    }
  6.    
  7. function calcHr(){
  8.  
  9.     var hr = parseInt(document.getElementById("hr_termino").value) - parseInt(document.getElementById("hr_inicio").value);
  10.     var min = parseInt(document.getElementById("min_termino").value) - parseInt(document.getElementById("min_inicio").value);
  11.    
  12.     if(min<0) {
  13.         min = min + 60;
  14.         hr = hr -1;
  15.         document.getElementById("time").value = padNmb(hr,2) + ":" + padNmb(min,2);
  16.         document.getElementById("ufValor").value = "$ " + Math.round((hr + min/60)* parseInt(document.getElementById("ocuUF").value) );       document.getElementById("chkRemoto").disabled= false;
  17.         document.getElementById("tecnicos").disabled= false;
  18.     }
  19.     else{
  20.         document.getElementById("time").value = padNmb(hr,2) + ":" + padNmb(min,2);
  21.         document.getElementById("ufValor").value = "$ " + Math.round((hr + min/60)* parseInt(document.getElementById("ocuUF").value) );        document.getElementById("chkRemoto").disabled= false;
  22.         document.getElementById("tecnicos").disabled= false;
  23.     }
  24.    
  25.     }
  26. function calc_tecnicos(cant) {
  27. calcHr();
  28. var hora = document.formVisita.time.value;
  29. //var cant = document.formVisita.tecnicos.value;
  30. var sep = hora.indexOf(":");
  31. var hr = hora.substr(0,sep)* 3600;
  32. var min = hora.substr(sep+1)* 60;
  33. var secs = (hr+min) * cant;
  34. hr = Math.floor(secs / 3600);
  35. min = Math.floor((secs - (hr*3600))/60);
  36. document.formVisita.time.value = (padNmb(hr,2) + ":" + padNmb(min,2));
  37. }

El problema es la funcion calc_tecnicos, porque en firefox me funciona perfecto, pero en IE no, a que se debe????.

Saludos

Etiquetas: Ninguno
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 06:25.