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

128
Views
Los datos no se envían desde XMLHttpRequest

Tengo un XMLHttpRequest con el que quiero enviar una cadena, pero recibe array(0) en la alerta, antes con x-www-form-urlencoded y sin stringify funcionaba pero no recibía los datos en el post, pero ahora ni eso, pero he leido que es como se debe hacer para enviar un string, luego les dejo el JS y el .php para que lo vean, muchas gracias de antemano :)

 var img = chartR.toDataURL("image/png"); document.getElementById('base64').value = img; var xhttp=new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == XMLHttpRequest.DONE) { alert(xhttp.responseText); } } xhttp.open("POST", base_url_admin+"record/reporte", true); xhttp.setRequestHeader("Content-type", "application/json"); let data = JSON.stringify({"resultChartImg": img}); xhttp.send(data);
 $resultChartImg = $_POST; var_dump($resultChartImg);exit();
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!