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

303
Views
Errror using API in chrome browser

I don't know how to fix this issue with using an API. It give me a browser error that says:

Access to XMLHttpRequest at 'file:///C:/Users/Gebruiker/Desktop/PokeMax/GET%20https://api.pokemontcg.io/v2/cards?s' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https. jquery-3.4.1.min.js:2 GET

file:///C:/Users/Gebruiker/Desktop/PokeMax/GET%20https://api.pokemontcg.io/v2/cards?s net::ERR_FAILED

If someone knows what the issue is I would love to hear it!

code:

$(document).ready(function (e) {

    $("#TheSubmitButton").on("click", function(event){
        event.preventDefault();
    
        var Pokemon = $("#search")
            .val()
            .trim()
        console.log(Pokemon);
    
    
    $.ajax({
    
      
        url: "GET https://api.pokemontcg.io/v2/cards?" + Pokemon,
        dataType: 'json',
        method: "GET"
    });
    
    
    });
    
    });
    
    // for (var i = 0; i < response.cards.length; i++) {
        //     var pokemonCard = $("<img>");
        //     pokemonCard.attr("src", response.cards[i].imageUrlHiRes);
        //     $("#card-container").append(pokemonCard);
        // }
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!