Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

305
Vistas
How to javascript debug the eval data?

Here's the issue,

at testing.html

<body>

<script type="text/javascript">

            var xmlhttp = new XMLHttpRequest();
            xmlhttp.onreadystatechange = function() {
                if (xmlhttp.readyState == XMLHttpRequest.DONE) {            
                if (xmlhttp.status == 200) {
                    //eval(xmlhttp.responseText);
                    console.log(xmlhttp.responseText);
                    alert(xmlhttp.responseText);
                }
                }
            };  

            xmlhttp.open("POST", "ajax.php", true);
            xmlhttp.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
</script>

<div id="debug1">a</div>

</body>

at ajax.php

echo " document.getElementById('debug1').innerHTML = '987';";

I want to be able to print out the thing at client side for debugging, without touching the php.

In this case, I want to be able to see the document.getElement whole code at console.

I changed it from eval to console.log / alert, but only can see empty output...

any way to debug this?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda