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

135
Vistas
text() not showing/rendered on iOS jQuery

Currently, I am making scanning function in my website.
And there is different time between last scan time and current time.
My script work normally in desktop browser and android browser, but it not showing same in iOS

Here is my code.

Example output in desktop and android devices

1 Hr 2 mins 1 sec ago

desktop

Example output in iOS ( chrome, Firefox and safari give same output )

ago

iOS

Only ago text show in iOS.
anyone know what's wrong with my code?

d = 74;
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
var hDisplay = h > 0 ? h + (h == 1 ? " hr" : " hrs") + (m > 0 || s > 0 ? ", " : "") : "";
var mDisplay = m > 0 ? m + (m == 1 ? " min" : " mins") + (s > 0 ? ", " : "") : "";
var sDisplay = s > 0 ? s + (s == 1 ? " sec" : " secs") : "";

differentTime = "last scan " + hDisplay + mDisplay + sDisplay + " ago "

console.log(differentTime)
$("#last-scan").text(differentTime);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>


<span id="last-scan" class='last-scan-text'> </span><span>by Scanner_19022 </span>

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