JavaScript - error en mozilla document.all undefined

 
Vista:
Imágen de perfil de enrique

error en mozilla document.all undefined

Publicado por enrique (1 intervención) el 22/03/2012 12:50:17
Hola, necesito ayuda estoy creando un test donde me dieron el codigo, lo que hice fue duplicarlo para que salgan dos test en una misma pantalla, he renombrado los formularios para que funcionen, he logrado que funcione en los navegadores menos en el mozilla y me sale error document.all.undefined, he leido que el document.all no funciona con el mozilla pero he visto que el codigo original si funciona, quisiera saber si el error lo produce por haberlo dupplicado que salga en la misma pantalla no he podido solucionarlo ni quitando el document.all y no se con que reemplazarlo si me pudieran ayudar lo agradeceria mucho, adjunto el codigo que tengo un saludo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<link href="oneColFixCtrHdr.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.Estilo1 {
	font-size: 19px;
	color: #333333;
}
body,td,th {
	font-family: calibri;
}
.Estilo2 {
	color: #0000FF
}
a:visited {
	text-decoration: none;
	color: #0000FF;
}
.Estilo3 {color: #FF0000}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
.Estilo11 {
	color: #0000FF;
	font-weight: bold;
	padding-left: 100px;
}
.ejemplo {
	color: #FF0000;
	font-weight: bold;
}
.celdas {
}
-->
</style>
<script language="javascript">
<!-- 
 
	
	Correcto = new Image();
	Correcto.src = "imagenes/check-micuenta.png";
	Mal = new Image();
	Mal.src = "imagenes/croix.png";
 
 
 
function Correccion() {
 
var respuesta_correcta_procesada=new
Array("GRANDE","SYMPA","BLEU","DIFFICILE","SYMPA");
 
var respuesta_correcta=new
Array("grande","sympa","bleu","difficile",
"sympa");
 
var num_aciertos = 0;
 
 
for (var i=0; i<5; i++){
 
respuesta=document.Preguntas.elements[i].value;
respuesta=respuesta.replace(/ /g,"");
respuesta=respuesta.replace(/´/g,"'");
respuesta=respuesta.toUpperCase();
 
respuesta=respuesta.replace(/'M/g,"AM");
respuesta=respuesta.replace(/'RE/g,"ARE");
respuesta=respuesta.replace(/'S/g,"IS");
respuesta=respuesta.replace(/'LL/g,"WILL");
respuesta=respuesta.replace(/'D/g,"WOULD");
respuesta=respuesta.replace(/'VE/g,"HAVE");
respuesta=respuesta.replace(/N'T/g,"NOT");
respuesta=respuesta.replace(/WON'T/g,"WILLNOT");
 
 
document.all.res[i].innerHTML="<span class=solucion>"+respuesta_correcta[i]+"</span>";
 
 
if (respuesta==respuesta_correcta_procesada[i]) {
document.images[i+1].src = Correcto.src;
num_aciertos++ ;
}
else {
document.images[i+1].src = Mal.src;
}
 
}
 
document.all.aciertos.innerHTML="<span class=resultado><b>"+num_aciertos+"</b> Respuestas Correctas</span>";
}
 
// -->
</script>
 
<script language="javascript"> 
<!-- 
 
	
	Correcto1 = new Image();
	Correcto1.src = "imagenes/check-micuenta.png";
	Mal1 = new Image();
	Mal1.src = "imagenes/croix.png";
 
 
 
function Correccion1() {
 
var respuesta_correcta_procesada1=new
Array("GRANDE","SYMPA","BLEU","DIFFICILE","SYMPA");
 
var respuesta_correcta1=new
Array("grande","sympa","bleu","difficile",
"sympa");
 
var num_aciertos1 = 0;
 
 
for (var i=0; i<5; i++){
 
respuesta1=document.Preguntas1.elements[i].value;
respuesta1=respuesta1.replace(/ /g,"");
respuesta1=respuesta1.replace(/´/g,"'");
respuesta1=respuesta1.toUpperCase();
 
respuesta1=respuesta1.replace(/'M/g,"AM");
respuesta1=respuesta1.replace(/'RE/g,"ARE");
respuesta1=respuesta1.replace(/'S/g,"IS");
respuesta1=respuesta1.replace(/'LL/g,"WILL");
respuesta1=respuesta1.replace(/'D/g,"WOULD");
respuesta1=respuesta1.replace(/'VE/g,"HAVE");
respuesta1=respuesta1.replace(/N'T/g,"NOT");
respuesta1=respuesta1.replace(/WON'T/g,"WILLNOT");
 
 
document.all.res1[i].innerHTML="<span class=solucion1>"+respuesta_correcta1[i]+"</span>";
 
 
if (respuesta1==respuesta_correcta_procesada1[i]) {
document.images[i+7].src = Correcto1.src;
num_aciertos1++ ;
}
else {
document.images[i+7].src = Mal1.src;
}
 
}
 
document.all.aciertos1.innerHTML="<span class=resultado1><b>"+num_aciertos1+"</b> Respuestas Correctas</span>";
}
 
// -->
</script>
<title>Documento Sin t&iacute;tulo</title>
</head>
<body class="oneColFixCtrHdr">
<script type='text/javascript'>function Go(){return}</script>
      <div id="header">
        <h1><img src="imagenes/banda.jpg" width="860" height="119" /></h1>
      <!-- end #header --></div>
      <div id="mainContent">
        <h1 align="left" class="Estilo1"><span class="Estilo2"><strong><a href="index.html">&lt;&lt;&lt;</a></strong><a href="index.html"> Home</a></span></h1>
        <h1 class="Estilo3">Présent : les verbes du 2e groupe (-ir)</h1>
<table width="100%" border="0"> <tr> 
    <td height="18"> 
      <p align="left" class="Estilo1"><strong>- Completa el texto con la palabras siguientes : grande, bleu, sympa, difficile.</strong></p></td></tr> </table>
 
<div align=center class="textonormal">
<form name=Preguntas action="Corrigir1.asp" method=get>
<table width="85%" border=0 align="center" cellpadding="0" cellspacing="0" class="tables">
<tr height=40 valign="middle">
<td width="10%" align="center" height="19">
<div align="center">
<center>
<p><img src="imagenes/nada.gif" width="22" height="22">
</center>
</div> </td>
<td width="5%" height="19" align="right" valign=middle><font class=textonormal><b>1.</b>&nbsp;</font></td>
<td width=45% height="19" align="left" valign=middle><span class=tabletext>&nbsp;
La tour est 
    <input class=box type=text name=p1 size=10>
</span></td>
<td width=45% height="19" align="left" valign=middle><div align="center"><span class=ejemplo id="res"> </span></div></td>
</tr>
<tr height=40 valign="middle">
<td width="10%" align="center" height="19">
<div align="center">
<center>
<p><img src="imagenes/nada.gif" width="22" height="22">
</center>
</div> </td>
<td width="5%" height="19" align="right" valign=middle><font class=textonormal><b>2.</b>&nbsp;</font></td>
<td width=45% height="19" align="left"><span class=tabletext>&nbsp;Il est vraiment tr&egrave;s
<input class=box type=text name=p2 size=10>
</span></td>
<td width=45% height="19" align="left" valign=middle><div align="center"><span class=ejemplo id="res"> </span></div></td>
</tr>
<tr height=40 valign="middle">
<td width="10%" align="center" height="19">
<div align="center">
<center>
<p><img src="imagenes/nada.gif" width="22" height="22">
</center>
</div> </td>
<td width="5%" height="19" align="right" valign=middle><font class=textonormal><b>3.</b>&nbsp;</font></td>
<td width=45% height="19" align="left"><span class=tabletext>&nbsp;
Le ciel est
  <input class=box type=text name=p3 size=10>
&nbsp;et il fait beau</span></td>
<td width=45% height="19" align="left" valign=middle><div align="center"><span class=ejemplo id="res"> </span></div></td>
</tr>
<tr height=40 valign="middle">
<td width="10%" align="center" height="19">
<div align="center">
<center>
<p><img src="imagenes/nada.gif" width="22" height="22">
</center>
</div> </td>
<td width="5%" height="19" align="right" valign=middle><font class=textonormal><b>4.</b>&nbsp;</font></td>
<td width=45% height="19" align="left"><span class=tabletext>&nbsp;
L'exercice est
  <input class=box type=text name=p4 size=10>
</span></td>
<td width=45% height="19" align="left" valign=middle><div align="center"><span class=ejemplo id="res"> </span></div></td>
</tr>
<tr height=40 valign="middle">
<td width="10%" align="center" height="19">
<div align="center">
<center>
<p><img src="imagenes/nada.gif" width="22" height="22">
</center>
</div> </td>
<td width="5%" height="19" align="right" valign=middle><font class=textonormal><b>5.</b>&nbsp;</font></td>
<td width=45% height="19" align="left"><span class=tabletext>&nbsp;
Il est vraiment tr&egrave;s
<input class=box type=text name=p5 size=10>
</span></td>
<td width=45% height="19" align="left" valign=middle><div align="center"><span class=ejemplo id="res"> </span></div></td>
</tr>
</table>

<div align=center><a href="javascript: Correccion();"><img src="imagenes/Corregir.gif" width="85" height="29" border=0 align="bottom"></a></div>
</form>
<br>
<table width="100%" border="0"> <tr> 
    <td height="18"> 
      <p align="left" class="Estilo1"><strong>- Completa el texto con la palabras siguientes : grande, bleu, sympa, difficile.</strong></p></td></tr> </table>
 
<div align=center class="textonormal">
<form name=Preguntas1 action="Corrigir1.asp" method=get>
<table width="85%" border=0 align="center" cellpadding="0" cellspacing="0" class="tables">
<tr height=40 valign="middle">
<td width="10%" align="center" height="19">
<div align="center">
<center>
<p><img src="imagenes/nada.gif" width="22" height="22">
</center>
</div> </td>
<td width="5%" height="19" align="right" valign=middle><font class=textonormal><b>1.</b>&nbsp;</font></td>
<td width=45% height="19" align="left" valign=middle><span class=tabletext1>&nbsp;
La tour est 
    <input class=box type=text name=p6 size=10>
</span></td>
<td width=45% height="19" align="left" valign=middle><div align="center"><span class=ejemplo id="res1"> </span></div></td>
</tr>
<tr height=40 valign="middle">
<td width="10%" align="center" height="19">
<div align="center">
<center>
<p><img src="imagenes/nada.gif" width="22" height="22">
</center>
</div> </td>
<td width="5%" height="19" align="right" valign=middle><font class=textonormal><b>2.</b>&nbsp;</font></td>
<td width=45% height="19" align="left"><span class=tabletext>&nbsp;Il est vraiment tr&egrave;s
<input class=box type=text name=p7 size=10>
</span></td>
<td width=45% height="19" align="left" valign=middle><div align="center"><span class=ejemplo id="res1"> </span></div></td>
</tr>
<tr height=40 valign="middle">
<td width="10%" align="center" height="19">
<div align="center">
<center>
<p><img src="imagenes/nada.gif" width="22" height="22">
</center>
</div> </td>
<td width="5%" height="19" align="right" valign=middle><font class=textonormal><b>3.</b>&nbsp;</font></td>
<td width=45% height="19" align="left"><span class=tabletext>&nbsp;
Le ciel est
  <input class=box type=text name=p8 size=10>
&nbsp;et il fait beau</span></td>
<td width=45% height="19" align="left" valign=middle><div align="center"><span class=ejemplo id="res1"> </span></div></td>
</tr>
<tr height=40 valign="middle">
<td width="10%" align="center" height="19">
<div align="center">
<center>
<p><img src="imagenes/nada.gif" width="22" height="22">
</center>
</div> </td>
<td width="5%" height="19" align="right" valign=middle><font class=textonormal><b>4.</b>&nbsp;</font></td>
<td width=45% height="19" align="left"><span class=tabletext>&nbsp;
L'exercice est
  <input class=box type=text name=p9 size=10>
</span></td>
<td width=45% height="19" align="left" valign=middle><div align="center"><span class=ejemplo id="res1"> </span></div></td>
</tr>
<tr height=40 valign="middle">
<td width="10%" align="center" height="19">
<div align="center">
<center>
<p><img src="imagenes/nada.gif" width="22" height="22">
</center>
</div> </td>
<td width="5%" height="19" align="right" valign=middle><font class=textonormal><b>5.</b>&nbsp;</font></td>
<td width=45% height="19" align="left"><span class=tabletext>&nbsp;
Il est vraiment tr&egrave;s
<input class=box type=text name=p10 size=10>
</span></td>
<td width=45% height="19" align="left" valign=middle><div align="center"><span class=ejemplo id="res1"> </span></div></td>
</tr>
</table>
<div align=center><a href="javascript: Correccion1();"><img src="imagenes/Corregir.gif" width="85" height="29" border=0 align="bottom"></a></div>
<p align="left" class="Estilo1"><span class="Estilo11"><a href="index.html">&lt;&lt;&lt; Home</a></span></p>
<p align="left" class="Estilo1">&nbsp;</p>
</form>
</div>
<script type="text/javascript"> 
/* <![CDATA[ */
(function(){try{var s,a,i,j,r,c,l=document.getElementsByTagName("a"),t=document.createElement("textarea");for(i=0;l.length-i;i++){try{a=l[i].getAttribute("href");if(a&&"cloudflare.com/email-protection"==a.substr(7 ,31)){s='';j=44;r=parseInt(a.substr(j,2),16);for(j+=2;a.length-j&&a.substr(j,1)!='X';j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}j+=1;s+=a.substr(j,a.length-j);t.innerHTML=s.replace(/</g,"&lt;").replace(/>/g,"&gt;");l[i].setAttribute("href","mailto:"+t.value);}}catch(e){}}}catch(e){}})();
/* ]]> */
</script>
<script type="text/javascript"> 
/* <![CDATA[ */
(function(){try{var s,a,i,j,r,c,l=document.getElementsByTagName("a"),t=document.createElement("textarea1");for(i=0;l.length-i;i++){try{a=1[i].getAttribute("href");if(a&&"cloudflare.com/email-protection"==a.substr(7 ,31)){s='';j=44;r=parseInt(a.substr(j,2),16);for(j+=2;a.length-j&&a.substr(j,1)!='X';j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}j+=1;s+=a.substr(j,a.length-j);t.innerHTML=s.replace(/</g,"&lt;").replace(/>/g,"&gt;");l[i].setAttribute("href","mailto:"+t.value);}}catch(e){}}}catch(e){}})();
/* ]]> */
</script>
</div>
      <div id="footer">
      <table width="100%" border="0">
  <tr> 
    <td height="31"> <div align="center"><font size="-1">&copy; Franc&eacute;s F&aacute;cil. Todos los derechos reservados. <a href="http://www.francesfacil.es" style="text-decoration: none; color: black;" target="_blank">Ejercicios de franc&eacute;s</a>. Prohibida la reproducci&oacute;n por cualquier 
        medio.<br>
        </font><font size="2">2012. <a href=""></a></font></div></td>
  </tr>
</table>
        <table width="100%" border="0">
  <tr> 
    <td> <div align="center"><font size="-1">Aviso legal: Este curso es gratuito 
        siempre que se visualice desde la p&aacute;gina Web de Franc&eacute;s F&aacute;cil. No est&aacute; 
        permitido descargar el curso.</font></div></td>
  </tr>
</table>
        <!-- end #footer --></div>
    <!-- end #container --></div>
    </body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder