ajax请求cordova地理位置

Hi I am new with ajax and trying to make a ajax request within the geolocation api in cordova. The longitude and latitude from the user should be sended to setlatcookie.php but it doesnt work. Where is the mistake? On my device is no error code showing only a white screen. The app run into a browser shell if it is heplful.

    <script type="text/javascript">
// Wait for device API libraries to load
    //
    document.addEventListener("deviceready", onDeviceReady, false);

    // device APIs are available
    //
    function onDeviceReady() {
        navigator.geolocation.getCurrentPosition(onSuccess, onError);
    }

    // onSuccess Geolocation
    //
    function onSuccess(position) {
latitude = position.coords.latitude;
longitude = position.coords.longitude;          


    xmlhttp.onreadystatechange=function()
    {

    }
    xmlhttp.open("GET","setlatcookie.php?la="+latitude,true);
    xmlhttp.send();

    xmlhttp.open("GET","setlatcookie.php?lo="+longitude,true);
    xmlhttp.send();
}

    }

    // onError Callback receives a PositionError object
    //
    function onError(error) {
        alert('code: '    + error.code    + '
' +
              'message: ' + error.message + '
');
    }
</script>

setlatcookie.php :

<?php

$latitude = $_GET["la"];
$longitude = $_GET["lo"];
$t = time() + 60 * 60 * 24 * 1000;
setcookie("latitude", $latitude, $t);
setcookie("longitude", $longitude, $t);

?>