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

170
Views
¿Por qué aparece [objeto Objeto] impreso en la pantalla y no su contenido real?

Tengo problemas con esta función de búsqueda en la que estoy trabajando. Yo (creo que) estoy pasando el contenido de una matriz de objetos a una var contactList y luego imprimo eso en la página web. En cambio, lo que obtengo es: ingrese la descripción de la imagen aquí

Aquí está parte de la función de búsqueda de mi archivo js, así como de mi html.

 function doSearch() { readCookie(); accessIdForEdit = ""; var lookUp = document.getElementById("searchText").value; document.getElementById("contactSearchResult").innerHTML = ""; var searchList = ""; var jsonPayload = JSON.stringify({search:lookUp, userId:userId}); var url = urlBase + '/LAMPAPI/search.' + extension; var xhr = new XMLHttpRequest(); xhr.open("POST", url, true); xhr.setRequestHeader("Content-type", "application/json; charset=UTF-8"); try { xhr.onreadystatechange = function () { if (this.readyState === 4 && this.status === 200) { document.getElementById("contactSearchResult").innerHTML = "Search has been retrieved"; var jsonObject = JSON.parse(xhr.responseText); for( var i=0; i<jsonObject.results.length; i++ ) { searchList += jsonObject.results[i]; if( i < jsonObject.results.length - 1 ) { searchList += "<br />\r\n"; } } document.getElementsByTagName("p")[0].innerHTML = searchList; } }; xhr.send(jsonPayload); } catch(err) { document.getElementById("contactSearchResult").innerHTML = err.message; } } <div id = "contactSearchDiv" style = "display: none"> <input type="text" id="searchText" placeholder="Contacts To Search For"/> <button type="button" id="confirmSearchButton" style="display:block" onclick="doSearch();"> Search </button></br> <button type="button" id="returnFromSearch" style="display:block" onclick="displayChange('mainPanel', 'contactSearchDiv');"> Return to Page </button><br/> <span id="contactSearchResult"></span> <p id="searchList"> </p><br /><br/> </div>
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!