Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safari cannot open the page because the address is invalid for Google Maps on iPad

We have a link that goes to Google Maps for directions using just the normal format for the Google Maps URL: https://www.google.com/maps/dir/Current+Location/38.8992,-77.0482.

This works fine on google chrome and other browsers don't seem to have this issue either, but somehow on the iPad with OS 8.1.3 using the Safari browser, an alert comes up with the message "Safari cannot open the page because the address is invalid"

Is anyone else experiencing this issue?

The page still does seem to load, but the alert pops up and needs to be dismissed and detracts from the user experience. Since the link follows the Google Maps API standard and seems to work otherwise, what is the reason this is happening and what can be done to stop this from happening?

Also, something strange happened when after the link works a few times, the message no longer comes up when the user is directed to the page. However, after clearing history and data for the Safari browser on iPad, the problem resurfaces again.

like image 844
Kevin Avatar asked Nov 09 '22 19:11

Kevin


1 Answers

In case anyone else arrived here but wasn't getting this error because of a Google Maps link, Look at any JS you have listening to the click event of the link.

In my case, I had discovered a previous developer added a

e.preventDefault();

to the click event.

like image 74
Adam Grant Avatar answered Nov 14 '22 21:11

Adam Grant