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

205
Visualizações
JS Geolocation countries dropdown

I use get ipapi.co/country for detecting the location country and then to make the select option active depending on this location. But it makes the form a little bit slow to render the country option. Can anyone recommend if I can make the response faster? This is the code I'm using:

$.get("https://ipapi.co/country/", function (t) {
            (clientCountry = "AU"), (clientCountry = t), $("#country option[value=" + clientCountry + "]").val(), $("#country option[value=" + clientCountry + "]").attr("selected", "selected");
            var e = $("#country option:selected").attr("age");
            $("#age-gate__country .ui-selectmenu-status").text($("select[name=country] option:selected").text());
            var a = new Date(new Date().setFullYear(new Date().getFullYear() - e)).toLocaleDateString("en-US");
        }),
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The code is so simple that I doubt is the performance bottleneck. The API or the request may be the bottleneck but that cannot be fixed (at least not by you but only by the API provider).

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