Article View: es.comp.lenguajes.java
Article #29128Re: JavaScript, Netscape y Explorer
From: Jos� Antonio Alc�zar
Date: Thu, 15 Jan 1998 00:00
Date: Thu, 15 Jan 1998 00:00
208 lines
5113 bytes
5113 bytes
Jos� Antonio Ruiz Gaona escribi� en mensaje
<34BB76F0.318D1BEB@ualm.es>...
>Ante todo, perdon por escribir sobre javaScript, pero es
que no conozco
>ningun foro de discusion mas apropiado que este...
>
> Mi problema es el siguiente : Estoy haciendo una pagina
web que, en
>tiempo de ejecucion (bueno, si se puede llamar asi) debe
escribir un
>texto cuando responda a un evento. Este ejemplo es bueno :
>
>
><HEAD>
> <TITLE>
> PRUEBA DE DOCUMENT.WRITE
> </TITLE>
> <SCRIPT LANGUAGE="JavaScript">
> function Funciona()
>
> alert("al ataque!!");
> document.write("Mensaje dinamico");
> }
> </SCRIPT>
></HEAD>
>
><BODY
> ONLOAD="Funciona()">
>
>Mensaje estatico
>
></BODY>
>
> Bueno, pues en IExploter 4 funciona bien,muestra el
'mensaje estatico'
>y despues el 'mensaje dinamico', y mira por donde, en
Nestcape 4.04 NO
>FUNCIONA!!! SE CUELGA DE MALA MANERA!!!!
>Y ESO QUE JavaScript FUE CREADO POR NETSCAPE!!!!!!!!
>
>Alguien sabe como arreglarlo?????
Basta con que despues del "mensaje dinamico" introduzcas un
salto de linea, es
decir que la linea quedaria:
document.write("Mensaje dinamico<BR>");
Debe ser que el Netscape no escribe la linea en el documento
hasta que no se le pone
el salto de linea.
>Ah! en otro orden de cosas, alguien conoce un TAG para
Netscape
>equivalente al <MARQUEE> de Exploter, o me lo tengo que
hacer en Java?
Pues que yo sepa no existe. Aqu� te env�o uno en Javascript
de los muchos que
pululan por ah�.:
<html>
<head>
<title>Scroll de Texto en JavaScript</title>
<script language="javascript"><!--
function scrl_param(){
this.bgn_ln="Estoy a punto de empezar...";
this.txt_ln="�Es divertido no?... "
+"pero si no est�s seguro... "
+"de si realmente... "
+"sirve para algo... "
+"haz clic en la p�gina... "
+"para pararlo... "
+"y haz clic aqu� dentro para arrancarlo... ";
this.end_ln="Ya est� hombre";
this.speed=100;
this.box_lg=70;
this.max=10;
this.count=0;
this.pos=0;
this.stop=0;
this.box_ln=" ";
if (this.txt_ln.length<this.box_lg)
this.msg_ln=this.txt_ln;
for(var i=0 ;i<(this.box_lg-this.txt_ln.length);i++)
this.msg_ln+=" ";
} else
this.msg_ln=this.txt_ln;
this.msg_ln+=" ";
}
}
var scrl=new scrl_param();
function scrlbox () {
if (scrl.pos>scrl.msg_ln.length) {
scrl.pos=1;
scrl.count++;
}
scrl.box_ln=" ";
scrl.box_ln+=scrl.msg_ln.substring(scrl.pos,scrl.msg_ln.leng
th);
scrl.box_ln+=scrl.msg_ln.substring(0,scrl.pos);
if (scrl.stop==0) {
document.scrlform.scrlbox.focus();
if (scrl.count<scrl.max)
scrl.pos++;
document.scrlform.scrlbox.value=scrl.box_ln;
time3=window.setTimeout('scrlbox()',scrl.speed);
} else {
if (scrl.end_ln.length>2) {
time2=window.setTimeout("document.scrlform.scrlbox.value="+
'scrl.end_ln',scrl.speed);
}
document.scrlform.scrlbox.blur();
}
}
}
function startscrl () {
scrl.stop=0;
scrl.pos=0;
scrlbox();
}
function stopscrl () {
scrl.stop=1;
}
//-- Final JavaScript-->
</script>
</head>
<body background="../../../img/fondos/frame_amarillo.gif"
bgcolor="#cccccc" text="#000000">
<table width="100%"><tr align="left" valign="top"><td><img
src="../../../img/logos/sweb42.gif" alt="[Logo]" width=42
height=32></td><td width="100%">
<script language="javascript"><!--
document.write("<p><center><form name='scrlform'>");
document.write("<input name='scrlbox' size="+scrl.box_lg+"
onFocus='startscrl();' onBlur='stopscrl();'
value='"+scrl.bgn_ln+"'>");
time1=window.setTimeout('scrlbox()',2000);
document.write("</form></center></p>");
//-- Final JavaScript-->
</script>
</td></tr></table>
<hr width="100%">
<center>
Última modificación: 28 de Septiembre de 1996
<br>
<a href="../../../index.html">© 1996 SergiWeb</a>
</center>
<br>
</body>
</html>
>
>[*] Gracias por la paciencia que tienes si has llegado a
leer esta
>ultima linea
Pues yo si que he llegado no se t�. Un saludo.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * *
* No dejes de visitarnos: http://www.elquijote.com *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * *
* EMAIL: elquijote@ran.es
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * *
Jos� Antonio Alc�zar G�mez del Moral joseant@ran.es
Technical Details
Message-ID:
<69m01j$4dv$1@talia.mad.ibernet.es>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34BB76F0.318D1BEB@ualm.es>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: 1116f3,62321e420f9fa3e4 X-Google-Attributes: gid1116f3,public From: "Jos� Antonio Alc�zar" <joseant@ran.es> Subject: Re: JavaScript, Netscape y Explorer Date: 1998/01/15 Message-ID: <69m01j$4dv$1@talia.mad.ibernet.es> X-Deja-AN: 316327764 References: <34BB76F0.318D1BEB@ualm.es> X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: IMAGINA2 Newsgroups: es.comp.lenguajes.java