Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of window.location doesn't work on iPad

I'm using some JavaScript that will redirect the user to another URL after a fixed period of time. This is working well on all browsers but on an iPad 3 I have to test on it isn't working. The timeout fires and I call

window.location = "www.someurl.com"; 

and I've also tried

  window.location.href = "www.someurl.com";

I can see the URL in the browser changing to www.someurl.ocom but the browser doesn't actually go there - it stays on the same page.

Is there something iPad specific I have to do to make this work?

Thanks

like image 322
LDJ Avatar asked May 23 '13 12:05

LDJ


People also ask

How do I fix my location on my IPAD?

Turn on Location Services and Location Access for Maps. In the Settings app, tap Privacy, then tap Location Services. Make sure Location Services is on, and make sure Maps is set to While Using the App or Widgets. Set the date, time, and time zone correctly on your device.

Does window location work in all browsers?

All modern browsers map document. location to the window. location but you can prefer window.

Does window location href work on mobile?

location. href and click() methods doesn't work on mobile phone. Bookmark this question.

How does window location work?

Windows location settings give you control over whether Windows features can access your device's location and which Windows apps can use your device's location and location history information. To check your location settings, go to Start > Settings > Privacy > Location.


1 Answers

try location.href = "...", should work on both

like image 185
Sagish Avatar answered Sep 22 '22 17:09

Sagish