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

132
Views
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
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!