Foros del Web » Programando para Internet » Javascript »

Dos javascript

Estas en el tema de Dos javascript en el foro de Javascript en Foros del Web. Por que cuando intento poner 2 javascript en mi pagina uno deja de funcionar? Saludos: Joel...
  #1 (permalink)  
Antiguo 19/07/2005, 18:36
Avatar de JoeLitO  
Fecha de Ingreso: febrero-2003
Ubicación: Perú
Mensajes: 202
Antigüedad: 22 años
Puntos: 0
Dos javascript

Por que cuando intento poner 2 javascript en mi pagina uno deja de funcionar?

Saludos: Joel
  #2 (permalink)  
Antiguo 19/07/2005, 22:01
Avatar de braulito  
Fecha de Ingreso: abril-2004
Ubicación: Cusco - Perú
Mensajes: 597
Antigüedad: 20 años, 9 meses
Puntos: 8
¿De qué manera los pones?
__________________
Braulio Soncco
braulio at buayacorp dot com
Buayacorp - Programación y Diseño
  #3 (permalink)  
Antiguo 20/07/2005, 03:09
Avatar de KarlanKas
Moderador extraterrestre
 
Fecha de Ingreso: diciembre-2001
Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 23 años, 1 mes
Puntos: 61
Si quieres una respuesta acertada prueba a poner el código de los dos scripts.
__________________
Cómo escribir

No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia.
  #4 (permalink)  
Antiguo 20/07/2005, 13:53
Avatar de JoeLitO  
Fecha de Ingreso: febrero-2003
Ubicación: Perú
Mensajes: 202
Antigüedad: 22 años
Puntos: 0
El tema es que deberia cuando le pongo un scrooll de texto este anula la hora que deberia de aparecer; Ese es mi codigo

----------------------------------------------------------------
<html>
<head>
<title>TITULO</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">

.gradualshine{
filter:alpha(opacity=30);
-moz-opacity:0.3;
}
.Estilo13 {font-size: 10px}
a:link {
color: #CCCCCC;
}
.Estilo15 {
color: #993400;
font-weight: bold;
}
</style>

<script type="text/javascript">

var baseopacity=30

function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",50)
}

function slowlow(which2){
cleartimer()
instantset(baseopacity)
}

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.sty le.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

</script>
<script>
function abrirpopup(nombre,ancho,alto) {
dat = 'width=' + ancho + ',height=' + alto + ',left=0,top=0,scrollbars=no,resize=no';
window.open(nombre,'',dat)
}
</script>
<script language="javascript" type="text/javascript">
<!--
var win=null;

function NewWindow(mypage,myname,w,h,scroll,pos){

if(pos=="random")
{LeftPosition=(screen.width)?Math.floor(Math.rando m()*(screen.width-w)):100;
TopPosition=(screen.height)?Math.floor(Math.random ()*((screen.height-h)-75)):100;}

if(pos=="center")
{LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;}

else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}

settings='width='+w+',height='+h+',top='+TopPositi on+',left='+LeftPosition+',scrollbars='+scroll+',l ocation=no,directories=no,status=no,menubar=no,too lbar=no,resizable=yes';

win=window.open(mypage,myname,settings);}
// -->
</script>
<SCRIPT LANGUAGE="JavaScript">
<!----------------

var submitcount=0;

function reset() {
document.emailform.reset();

}

var reqFields = new parseArray("email");
var reqFieldsDesc = new parseArray("El ingreso de tu correo");

function parseArray() {
this.length = parseArray.arguments.length
for (var i = 0; i < this.length; i++) {
this[i+1] = parseArray.arguments[i]
}
}
function validEmail(email) {
invalidChars = " £$%*?!#/:,;"

if (email == "") {
return false
}
for (i=0; i<invalidChars.length; i++) {
badChar = invalidChars.charAt(i)
if (email.indexOf(badChar,0) > -1) {
return false
}
}
atPos = email.indexOf("@",1)
if (atPos == -1) {
return false
}
if (email.indexOf("@",atPos+1) != -1) {
return false
}
periodPos = email.indexOf(".",atPos)
if (periodPos == -1) {
return false
}
if (periodPos+3 > email.length) {
return false
}
return true
}
function validname(name) {
invalidChars = "£$%*?!#/:,;1234567890"

if (recip_name == "") {
return false
}
for (i=0; i<invalidChars.length; i++) {
badChar = invalidChars.charAt(i)
if (name.indexOf(badChar,0) > -1) {
return false
}
}
return true
}
function validForm(obj) {
var errMsg = '';
var x = 0;
for (x = 1; reqFields.length >= x ; x++) {
if ((obj.elements[reqFields[x]].value == '') || (obj.elements[reqFields[x]].value == ' ')) {
errMsg = errMsg + '' + reqFieldsDesc[x] + ' es obligatorio.\n';
}
}
if (errMsg != '') {
errMsg = 'error:\n\n' + errMsg + '\nPor favor revisa tu dirección de correo';
alert(errMsg);
return false;
}
if (!validEmail(obj.email.value)) {
alert("ERROR!!! verifica tu direccion de correo.")
obj.email.focus()
obj.email.select()
return false
}
if (submitcount == 0)
{
submitcount++;
return true;
}
else
{
alert("Fue enviado con exito.");
return false;
}
return true
}
//------------------------------>
</SCRIPT>
</head>
<body>
<p>
</p>
<table width="748" border="0">
<tr valign="top">
<td width="40"><img src="Imagenes/Reloj.gif" width="40" height="26"></td>
<td width="219" valign="middle">
<!-- Inicio de hora del sistema -->
<script language="javascript" src="JS/reloj.js"></script>
<script language="javascript"><!--
new LiveClock("arial","1","#ffffff","#","<b>Hora de sistema&nbsp;","</b>","235","1","1","0","2","null");
//--></script>
</td>
<td width="40" valign="middle"><img src="Imagenes/usuario.gif" width="40" height="26"></td>
<td width="301" valign="middle">

<strong><font color="#ffffff" size="1" face="Arial">
<script
language="JavaScript">
hora = new Date();
var minutos = hora.getMinutes ();
if (minutos<=9) minutos = "0" + minutos;

</script> </font> </strong>
<font size="1" face="Arial" color="#ffffff"><script language="JavaScript"><!--
if (hora.getHours() == "0"){
document.write("¿No tienes sueño?")}

// --></script></font>

<!-- INICIO DEL CODIGO DEL SCROLL -->
<tr>
<td height="68" valign="top" bgcolor="#FFFDDD">
<div align="left" class="Estilo15">
<script language="JavaScript1.2">


//Specify the marquee's width (in pixels)
var marqueewidth="150px"
//Specify the marquee's height
var marqueeheight="100px"
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=1
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1

//Specify the marquee's content
//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

var marqueecontent='<font face="Verdana">MENSAJE DEL SCROLL</font>'


marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
var actualheight=''
var cross_marquee, ns_marquee

function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.top=parseInt(marqueeheight)+8+ "px"
cross_marquee.innerHTML=marqueecontent
actualheight=cross_marquee.offsetHeight
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee 2
ns_marquee.top=parseInt(marqueeheight)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualheight=ns_marquee.document.height
}
lefttime=setInterval("scrollmarquee()",20)
}
window.onload=populate

function scrollmarquee(){

if (iedom){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.sty le.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+ "px"
}
else if (document.layers){
if (ns_marquee.top>(actualheight*(-1)+8))
ns_marquee.top-=copyspeed
else
ns_marquee.top=parseInt(marqueeheight)+8
}
}

if (iedom||document.layers){
with (document){
if (iedom){
write('<div style="position:relative;width:'+marqueewidth+';he ight:'+marqueeheight+';overflow:hidden" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
write('<div id="iemarquee" style="position:absolute;left:0px;top:0px;width:10 0%;">')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">')
write('<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
write('</ilayer>')
}
}
}
</script>
</div></td>
</tr>
</td>
<!-- FIN DEL CODIGO DEL SCROLL -->


</body>
</html>
--------------------------------------------------

Gracias
Joel Osorio Díaz
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 21:02.