From: Maxious Date: Mon, 22 Aug 2011 12:56:13 +0000 Subject: Fix geolocation ajax on iOS devices X-Git-Url: http://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=3007d93d8eceebdafcea41249ae68ce5e76fd1fc --- Fix geolocation ajax on iOS devices --- --- a/include/common-template.inc.php +++ b/include/common-template.inc.php @@ -98,8 +98,11 @@ function success(position) { $('#error').val('Location now detected. Please wait for data to load.'); $('#geolocate').val(position.coords.latitude+','+position.coords.longitude); -$.ajax({ url: \"include/common.inc.php?geolocate=yes&lat=\"+position.coords.latitude+\"&lon=\"+position.coords.longitude }); -location.reload(true); +$.ajax({ async: false, +success: function(){ + location.reload(true); + }, +url: \"include/common.inc.php?geolocate=yes&lat=\"+position.coords.latitude+\"&lon=\"+position.coords.longitude }); } function error(msg) { $('#error').val('Error: '+msg); --- a/include/common.inc.php +++ b/include/common.inc.php @@ -32,7 +32,7 @@ function isDebugServer() { - return php_sapi_name() == "cli" || isset($_SERVER['SERVER_NAME']) && ( $_SERVER['SERVER_NAME'] == "10.0.1.154" || $_SERVER['SERVER_NAME'] == "10.1.0.4" || $_SERVER['SERVER_NAME'] == + return php_sapi_name() == "cli" || isset($_SERVER['SERVER_NAME']) && ( $_SERVER['SERVER_NAME'] == "vanille" || $_SERVER['SERVER_NAME'] == "10.1.0.4" || $_SERVER['SERVER_NAME'] == "localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1") ; }