私は私の地理位置を取得することができ、私はそれをテストして動作します。wunderground APIに緯度と経度の値を渡す方法
var lat;
var long;
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var lat= position.coords.latitude;
var long=position.coords.longitude;
// $(".data-now").html("latitude: " + lat + "<br>longitude: " +long);
});
以下のように私はそれが動作しません、私のAPIでこれらの変数が長いと緯度渡すとき、私は、ここで私はそれをやった方法ですので、今変数に経度と緯度の値を設定し
$.ajax({
url : "//api.wunderground.com/api/8c89bxxxxf56bc94/conditions/q/lat,long.json",
dataType : "jsonp",
success : function(answer) {
var location = answer['current_observation']['display_location']['full'];
var temp_f = answer['current_observation']['temp_f'];
var temp_c = answer['current_observation']['temp_c'];
var weather = answer['current_observation']['weather'];
var icon = answer['current_observation']['icon_url'];
どんな助け?
??
どの時点で、lat/longをサーバーに渡しますか? –