I'm using javascript to lookup a user's location based on the IP address. It works great for everything except cellular networks (which, unfortunately, is the bulk of my site's visitors). For cellular connections, the location is often off by 100 miles or more.
A stripped down version of the site is here: http://autopilothomelistings.com/ab/geoip13.html
I'm trying to figure out a way to determine if a visitor to my site is on a wireless connection or on Wifi/LAN, so that I can display alternate content depending on the connection type, but I haven't found a suitable answer. I can check for the device or browser, but these are not helpful, since a 'mobile' device can either be on wifi (which results in an accurate location) or on cellular (which is inaccurate).
I found a few threads that were somewhat relevant, but didn't ultimately provide any help:
1.) Thread discussing Apple's Reachability class: How to identify internet connection type and it's current speed
2.) Thread discussing navigator.connection: How do I check connection type (WiFi/LAN/WWAN) using HTML5/JavaScript? - which look promising in theory, but when I looked at the documentation here: https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation.connection - it appears to unsupported by the major browsers.
3.) Thread that uses javascript to determine connection speed: How to Determine Connection Type in JavaScript
Any ideas are greatly appreciated. I'm hoping there is an easy way to check the connection type on the client-side.