1

How can I import a JSON object from a website without using libraries like JQuery? I'd like to access some data using pure JavaScript. Thanks in advance!

1

1 Answer 1

1
fetch("some url that returns json")
  .then(res => {
    res.json()
  })
  .then(data => {
    do something with the data
  })
Sign up to request clarification or add additional context in comments.

1 Comment

While this code may answer the question, providing additional context regarding why and/or how this code answers the question improves its long-term value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.