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

182
Views
NetworkError when attempting to fetch resource in jsfiddle

I'm making an autocomplete function for a webpage where users can find information about cities and their airports by typing the first letters of the city/airport name. I use javascript fetch for receiving all the active airports from the API:

let airports; 

fetch("http://api.travelpayouts.com/data/ru/airports.json")
    .then(data => data.json())
    .then(data => airports = JSON.parse(data))
    .catch(error => console.log(error.message));

It works locally but in case of jsfiddle.net i receive an error:

NetworkError when attempting to fetch resource.

I googled the problem but could only find the reason of such behavior and no solution so I end up with just hardcoding the response body into the fiddle. Any ways to fix it properly?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you check the browser console, you will find this:

Mixed Content: The page at 'https://jsfiddle.net/' was loaded over HTTPS, but requested an insecure resource 'http://api.travelpayouts.com/data/ru/airports.json'. This request has been blocked; the content must be served over HTTPS.

You can't make a request from a site loaded over HTTPS to an insecure resource(http).

One work around while development would be to change the site settings on your browser by allowing insecure content.

about 4 years ago · Juan Pablo Isaza Report
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!