so, I should start by saying that I don't really understand callbacks (but I understand what they do), and here's the thing:

html5 browser geolocation has an error callback which works fine EXCEPT if the user is using FF and refuses to share their location. In IE and Chrome, this produces a "permission denied" error which you can then handle. But firefox just sits there because it never receives the error. Here's an example - click on Not now in FF to see what I mean.

So the only solution I can see is to make some special case for FF and this is where my question comes in - can I set a condition within the callback that says something like if it wasn't successful, but you didn't get an error, do this...

I thought that if (!position&&!error) {useMaxMind("Firefox fallback"); } might do it, but it can't go in the error callback (I guess because that only fires if an error is detected) and it doesn't work in the main function (I guess because if that code runs it means the location has been found)...

anyway. Here's what I have for the moment, which just sets a timeout as soon as it loads. It would be nice to have something a bit more elegant, though.

thanks in advance...

Code:
    function initialize() {
      // try W3C standard approach
	  var geoTimeout = 10000;
      var timeOuthandler = setTimeout("useMaxMind('Timeout')", geoTimeout);
     if(navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
      var latLong = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
	  alert("geolocation successful");
	  clearTimeout(timeOuthandler);
     showMap(latLong, 16);
    }, function (error)	{
	    switch (error.code) {
        case 0:
            message = "Something went wrong: " + error.message;
            break;
        case 1:
            message = "You denied permission to this page to retrieve a location.";
            break;
        case 2:
            message = "The browser was unable to determine a location: " + error.message;
            break;
        case 3:
            message = "The browser timed out before retrieving the location.";
            break;
    }	clearTimeout(timeOuthandler);
	          useMaxMind(message);
        }, {timeout:geoTimeout} );
	 } else {
	useMaxMind("No browser support");
		}
	}