2

私は4時間試していた問題があり、運がありません。ポジションを受け取ったら、データベースを検索して結果を取得し、それを画面に表示する必要があります。

データベースへのクエリは完了しましたが、成功関数はデータを受け取りません。アイデアはありますか?

   function initiate_geolocation() {  
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(handle_geolocation_query, handle_errors, {enableHighAccuracy:true});  
    } else {
       yqlgeo.get('visitor', normalize_yql_response);
       /*jQuery("#current-location").html("No geolocation support."); */
    }

    return false;
}

function handle_geolocation_query(position){  
    jQuery.post("/index.php?r=location/current", { "latitude": position.coords.latitude, "longitude": position.coords.longitude },
                                        function(data){
                                            jQuery("#zipcode").val(data);
                                        }, "json");    
}  

function handle_errors(error) {
           /*Not important*/
} 

function normalize_yql_response(response)  
    {  
        /*Not important*/
    }  
4

0 に答える 0