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

181
Views
window.location.origin not working on mobile devices?

I have a javascript code where I update a (full-)URL string to get the relative path only:

const url = 'http://www.example.com/map/123'.replace(window.location.origin, "");
console.log(url);

This code, when running on http://www.example.com, would log /map/123.

It works fine on my computer, but I noticed that on my Ipad and on my Android phone, the origin is not stripped.

Is window.location.origin not compatible with all browsers ? And in that case, how should I handle this ?

Thanks

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!