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

101
Views
jQuery getJSON function is not returning any output

I wanted build a web 8ball app, I wanted to use PHP for it. I included jQuery and I set everything up, but my .getJSON function wasnt working

var button = document.getElementById("submitsend")

button.onclick = async function() {
  var input = document.getElementById("userinput")
  input.value = ""
  var output = document.getElementById("output")
  $.getJSON("https://api.eriner.repl.co/fun/8ball", function(data) {
    console.log(data)
  })
}
<link rel="stylesheet" href="https://easycss.bookie0.repl.co/dark.css">

<nav>
  <h1>Hello</h1>
</nav>
<div class="content">
  <p id="output">Ask me anything.</p>
  <form onsubmit="return false" id="formm">
    <input id="userinput" placeholder="Say something." type="text">
    <button type="button" id="submitsend">Send</button>
  </form>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

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!