AJAX - WARNING EN AJAX

 
Vista:

WARNING EN AJAX

Publicado por julian (1 intervención) el 10/05/2018 05:13:57
Hola qué tal, quería hacerles una consulta ya que no encuentro en ningun foro español la respuesta a este caso.
Estoy intentando hacer un chat en ajax y lo pruebo en la red local via XAMPP y funciona todo ok. Pero cuando lo subo al servidor para probarlo me tira el siguiente warning:
1
(index):65 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
No puedo encontrar el error, quisiera ver si me pueden ayudar, pasaré el código a ver si pueden ver qué pasa. Desde ya muchas gracias.
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
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>CHAT EN AJAX</title>
</head>
<body>
<input type="textbox" name="" id="nombre"> <button id="btnNombre" onclick="nombreguardado();">Guardar</button>
<textarea disabled  rows="30" id="grandote" style="overflow: auto; width: 100%; margin: 0 auto;"></textarea><br>
<center>
<input type="textbox" id="textboxing"><button id="boton" onclick="EnviarDato();">Enviar</button>
<p id="alerta"></p>
</center>
<button onclick="lectura();">CARGAR</button>
<button onclick="borrarChat();">BORRAR CHAT</button>
<script type="text/javascript">
var conexion;
 
function nombreguardado(){
	if (document.getElementById("nombre").value != "") {
document.getElementById('nombre').disabled =true;
	}else{
		alert("fail")
	}
}
var eliminar;
function borrarChat(){
	eliminar=1;
conexion = new XMLHttpRequest();
conexion.onreadystatechange = enviado;
conexion.open("GET", 'procedimiento.php?eliminar='+eliminar, true);
conexion.send();
 
}
 
	function EnviarDato(){
	var entrada = document.getElementById("textboxing").value;
	var nombre = document.getElementById("nombre").value;
	var boton = document.getElementById("boton");
 
	enviarxml(entrada,nombre);
	}
function enviarxml(texto,nombre){
conexion = new XMLHttpRequest();
conexion.onreadystatechange = enviado;
conexion.open("GET", 'procedimiento.php?texto='+texto+'&nombre='+nombre, true);
conexion.send();
}
var alerta = document.getElementById("alerta");
function enviado(){
	if (conexion.readyState==4) {
		alerta.innerHTML = "MENSAJE ENVIADO";
	}
	else{
		alerta.innerHTML="ENVIANDO MENSAJE...";
	}
}
var grande = document.getElementById("grandote");
var leccion = new XMLHttpRequest();
function lectura(){
 
leccion.open("GET","archivo.txt",false);
leccion.send();
grande.innerHTML=leccion.responseText;
}
setInterval(lectura, 1);
</script>
</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