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

103
Views
la respuesta ajax devuelve cada valor como un solo carácter

Estoy tratando de averiguar dónde me equivoqué en esta solicitud. Tengo una solicitud de publicación de ajax y recibo la respuesta como un solo carácter. Por ejemplo, en lugar de "nombre": "juan" obtengo:
norte
a
metro
mi
j
o
h
norte
Este es mi código:

 $.ajax({ url: 'test.php', type: "POST", data: ({ name: 'john' }), success: function(data) { var JSONString = data; var JSONObject = JSON.parse(JSONString); console.log(JSONString); load(JSONString); }, error: function() { alert('error'); } }); } <?php $db = new SQLite3('database.db'); $userAnswer = $_POST['name']; $results= $db->query("SELECT * FROM 'database' where name='".$userAnswer."'"); $data= []; while ($res= $results->fetchArray(1)) { array_push($data, $res); } echo json_encode($data); ?> function load(res) { var JSONObject = res; var arr = Object.values(JSONObject); for (var i = 0; i < arr.length; i++) { } } }
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!