Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

303
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!