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

249
Views
El código xmlHTTPRequests no funciona para obtener json de jsonbin

Voy a obtener un archivo json de jsonbin al hacer clic en un botón, pero no funciona, se agradece su ayuda.

 <button id="runxhr">RUN XHR</button> <div id="main"></div>

js archivo está aquí:

 function runXHR() { let xhr = new XMLHttpRequest(); addListeners(xhr); xhr.open( "GET", "https://api.jsonbin.io/v3/b/62b4395c449a1f3821167058/", true ); xhr.setRequestHeader("X-Bin-Meta", "false"); xhr.send(); return xhr.responseText; } function addListeners(xhr) { xhr.addEventListener("loadend", display(xhr)); } function display(jsonstring) { let main = document.getElementById("main"); json = JSON.parse(jsonstring); main.innerHTML = json[0]["name"]; } const buttnRun = document.getElementById("runxhr"); buttnRun.addEventListener("click", () => { runXHR(); });
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!