Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

151
Visualizações
Http get request from local file with a system URL

So I've made a simple .html file and a simple .js script. It's very simple, just a button that should make an http.get request once pressed. The get request does get created once I press the button, I also get a response from the request (code 200, can see the data in debugger) but I also get a 304-blocked code(blocked by CORS). I'm using jquery ajax to create the request.

My question is - I can create get requests from local file, but I can not use the data I get back... Why is that and how do I fix it?

Edit1: I did not provide code because it is trivial, but in order to please responders that probably did not even read the question - here is the code.

<body><div><button onClick=pressed()>Press</button></div></body>
<script>function pressed(){
    $.ajax({
        url: some_url,
        data: some_data,
        dataType: 'json'
    })
}
</script>

Edit2: As @alwayS_U pointed out - I am executing my .html file with a system URL (Example : "D:/some.html"). My question is about if I can make this request and get&use the data without setting up any kind of a server?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I think you are executing your html file with system url, Example : "D:/some.html". If you run your html file with (XAMPP server or, VS code - live server extension), you may get your data without 304 error code.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda