Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

199
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda