Foros del Web » Programando para Internet » Javascript »

Java script eninternet explorer y netscape

Estas en el tema de Java script eninternet explorer y netscape en el foro de Javascript en Foros del Web. hola amigos bueno mi duda es la siguiente tengo unas paginas en las cuales utilizo java script pero el cual funciona prefectamente en internet explorer ...
  #1 (permalink)  
Antiguo 03/03/2006, 11:59
 
Fecha de Ingreso: febrero-2006
Mensajes: 142
Antigüedad: 18 años, 3 meses
Puntos: 0
Java script eninternet explorer y netscape

hola amigos bueno mi duda es la siguiente tengo unas paginas en las cuales utilizo java script pero el cual funciona prefectamente en internet explorer pero cuando las abro en opera o en netscape el java script no funciona me podrian decir porque y como solucionarlo
  #2 (permalink)  
Antiguo 03/03/2006, 12:01
Avatar de JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Hola ever_diaz8

Pon el código que no te funciona, porque así a ciegas va ser difícil contestarte.

Saludos,
  #3 (permalink)  
Antiguo 03/03/2006, 12:05
 
Fecha de Ingreso: febrero-2006
Mensajes: 142
Antigüedad: 18 años, 3 meses
Puntos: 0
por ejemplo esto no sirve en netscape

Código:
function valida()
{

	if (document.getElementById('Name').value=="" || document.getElementById('Mailx').value=="" || document.getElementById('Telephone').value=="" ||document.getElementById('Fax').value ==""||document.getElementById('Address').value==""||document.getElementById('Comments').value=="")
	{
	alert("debes de llenar todos los registros");
	}
	else
	{
	var mytex=document.getElementById('Mailx').value;
	var mytel=document.getElementById('Telephone').value;
	var myfax=document.getElementById('Fax').value;
	if (validaMail(mytex))
	{
		if (isPhoneNumber(mytel))
		{
			if (isPhoneNumber(myfax))
			{
				if (document.getElementById("sel").value==0)
				{
					alert("DEBES ELEGIR UN CONTACTO");
				}
				if (document.getElementById("sel").value==1)
				{
					document.getElementById("td_name").innerHTML+='<input type="hidden" name="title" id="title" value="INFORMACION Y PREGUNTAS">';
					window.form1.submit();
				}
				if (document.getElementById("sel").value==2)
				{
					document.getElementById("td_name").innerHTML+='<input type="hidden" name="title" id="title" value="INFORMACION DE PRODUCTOS">';
					window.form1.submit();
				}
				if (document.getElementById("sel").value==3)
				{
					document.getElementById("td_name").innerHTML+='<input type="hidden" name="title" id="title" value="VENTAS">';
					window.form1.submit();
				}
			
				
				
			}
			else
			{
			alert("El numero del fax es incorrecto!!")
			document.getElementById('Fax').value="";
			document.getElementById('Fax').focus()
			}
		}
		else
		{
		alert("El telefono es incorrecto!!");
		document.getElementById('Telephone').value="";
		document.getElementById('Telephone').focus()
		}
	}
	}
	
}

function validaMail(Objeto)
  {
var my_val=document.getElementById('Mailx').value;	  


     if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(my_val)){	   
    return (true)
     } else {
			alert("Dirección de e-mail invalida!!");
			alert(my_val);
			document.getElementById('Mailx').value="";
			document.getElementById('Maixl').focus()
			
			return (false);}
  }



/*funciones para validar numero de telefono */

var defaultEmptyOK = false
var phoneChars = "()-+ ";
function isPhoneNumber (s)
{   var modString;
    if (isEmpty(s)) 
       if (isPhoneNumber.arguments.length == 1) return defaultEmptyOK;
       else return (isPhoneNumber.arguments[1] == true);
    modString = stripCharsInBag( s, phoneChars );
    return (isInteger(modString))
}
function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}
function isInteger (s)
{   var i;
    if (isEmpty(s)) 
       if (isInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isInteger.arguments[1] == true);
    
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if( i != 0 ) {
            if (!isDigit(c)) return false;
        } else { 
            if (!isDigit(c) && (c != "-") || (c == "+")) return false;
        }
    }
    return true;
}
function stripCharsInBag (s, bag)
{   var i;
    var returnString = "";

    // Buscar por el string, si el caracter no esta en "bag", 
    // agregarlo a returnString
    
    for (i = 0; i < s.length; i++)
    {   var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }

    return returnString;
}
function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}
function show(val)
{
if (val==0)
{
document.getElementById("div_f").style.display='none';

}
else
{
document.getElementById("div_f").style.display='block';

}

}

function sel_body(tem)
{
	if(tem==1)
	{
	document.getElementById("td_u").innerHTML+='<input type="hidden" name="bodysel" id="title" value="1">';
	window.fm.submit();
	}
	if(tem==2)
	{
	document.getElementById("td_u").innerHTML+='<input type="hidden" name="bodysel" id="title" value="2">';
	window.fm.submit();
	}
	
	
	if(tem==3)
	{
	document.getElementById("td_u").innerHTML+='<input type="hidden" name="bodysel" id="title" value="3">';
	window.fm.submit();
	}
}

function sel()
{
alert('hola');	
}

function insert_u()
{
if (document.getElementById("name").value=="" && document.getElementById("user").value==""&&document.getElementById("status").value==2)
	{
	alert("debes llenar al menos un registro entre Nombre,Nickname o Staus");
	}
	else
	{
		document.getElementById("td_in").innerHTML+='<input type="hidden" name=action value="2">';
	window.f_user.submit();
	}	
}

Última edición por ever_diaz8; 03/03/2006 a las 12:13
  #4 (permalink)  
Antiguo 03/03/2006, 12:07
 
Fecha de Ingreso: febrero-2006
Mensajes: 142
Antigüedad: 18 años, 3 meses
Puntos: 0
disculpen yo se que es mucho codigo pero por ejemplo de esto la funcion insert_u no funciona para nada en netscape o otros y me podrian decir porque el onclick en un boton normal no funciona en netscape
  #5 (permalink)  
Antiguo 03/03/2006, 12:18
Avatar de JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Hola de nuevo.

Pon también el formulario, para poder hacer algunas pruebas, pero en principio parece que el código es correcto y no debería dar ningún problema en Netscape. Tampoco entiendo lo de que no funciona el onclick de un botón

Saludos,
  #6 (permalink)  
Antiguo 04/03/2006, 02:48
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Tema trasladado desde Web general
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 15:32.