Jquery 从自动检测更改为自动完成wunderground
这是我的代码吹地下天气,他都准备好工作良好,但我想作出改变,这一变化很好地从自动检测到自动完成api,我尝试,但得到错误,我只是有人编辑我的代码更改为自动完成apiJquery 从自动检测更改为自动完成wunderground,jquery,api,autocomplete,wunderground,Jquery,Api,Autocomplete,Wunderground,这是我的代码吹地下天气,他都准备好工作良好,但我想作出改变,这一变化很好地从自动检测到自动完成api,我尝试,但得到错误,我只是有人编辑我的代码更改为自动完成api jQuery(document).ready(function(weather) { $.ajax({ url : "http://api.wunderground.com/api/eb7a37c339cfd624/geolookup/conditions/forecast10day/lang:AR/q/autoip.jso
jQuery(document).ready(function(weather) {
$.ajax({
url : "http://api.wunderground.com/api/eb7a37c339cfd624/geolookup/conditions/forecast10day/lang:AR/q/autoip.json",
dataType : "jsonp",
timeout: 8000,
error: function(jqXHR) {
if(jqXHR.status==0) {
alert(" يرجى تØقيق من اتصالك بالانترنت ")
}
},
success : function(data) {
var degree = data.current_observation.wind_degrees;
var direction = check(degree);
///information //
var html = ' <div class="ui-grid-solo"> <div class="ui-block-a">';
html += '<h1 class="text-center">'+ data.current_observation.temp_c + '</h1>'
html += '<h4 class="text-center">'+ data.current_observation.display_location.city + '</h4>'
html += '<h4 class="text-center">'+ data.current_observation.observation_time + '</h4>'
html += '</div></div>';
$("#temp").append(html).hide().fadeIn("slow");
///forecast now //
var html = '<div class="ui-grid-a"><div class="ui-block-a">';
html += ''+ direction + ''
html+= '<h3 class="text-center"> بسرعة '+data.current_observation.wind_kph + ' عقدة </h3></div>'
html+= ' <div class="ui-block-b"><h3 class="text-center">الاجواء '+ data.current_observation.weather +'</h3><table style="width: 100%"><tr style="text-align: -moz-center;"><td style="width: 1%"><span style="width: 10%; text-align: center;text-align: center; font-size: 25px;"class="text-center">'+ data.current_observation.feelslike_c +'</span></td><td style="width: 19%"><span style="font-size:20px;">شعور بها</span><img src="http://icons.iconarchive.com/icons/iconsmind/outline/32/T-Shirt-icon.png" style="float: right; width: 25px;" /></td></tr></table><table style="width: 100%"><tr><td style="float: right;font-size:large;direction:rtl"> الرطوبة '+ data.current_observation.relative_humidity +'</td><td style="width: 50px"><img src="http://icons.iconarchive.com/icons/icons8/windows-8/24/Science-Humidity-icon.png" /style="float: right;"></td></tr></table> <table style="width: 100%"><tr><td style="font-size: 18px;"> ضغط جوي '+ data.current_observation.pressure_mb +'</td><td style="width: 25px"><img src="http://icons.iconarchive.com/icons/icons8/ios7/24/Science-Pressure-icon.png" /style="float: right;"></td></tr></table>'
html += '</div></div>';
$("#news").append(html).hide().fadeIn("slow");
//wind//
var html = '<div class="ui-grid-a"><div class="ui-block-a">';
html += ''+ direction + ''
html+= '<h3 class="text-center"> بسرعة '+data.current_observation.wind_kph + ' عقدة </h3></div>'
html+= ' <div class="ui-block-b"><h3 class="text-center"> بسرعة '+data.current_observation.wind_kph + ' عقدة </h3>'
html += '</div></div>';
$("#wind").append(html).hide().fadeIn("slow");
///10days///
var dayArray = data.forecast.txt_forecast['forecastday'];
var html = '<div>';
for(var i=0; i<dayArray.length; i+=2)
html += '<h3>'+data.forecast.txt_forecast.forecastday[i]['title']+ " : " +data.forecast.txt_forecast.forecastday[i]['fcttext_metric']+'</h3></div>'
html += '</div>';
$("#10").append(html).hide().fadeIn("slow");
}
});
});
jQuery(文档).ready(函数)(天气){
$.ajax({
url:“http://api.wunderground.com/api/eb7a37c339cfd624/geolookup/conditions/forecast10day/lang:AR/q/autoip.json",
数据类型:“jsonp”,
超时:8000,
错误:函数(jqXHR){
if(jqXHR.status==0){
警觉(“ÙÙÙÙÙÙÙÙÙÙÙÙمنÙ
}
},
成功:功能(数据){
var度=数据、当前观测值、风力度;
var方向=检查(度);
///信息//
var html='';
html+=''+data.current_observation.temp_c+''
html+=''+data.current_observation.display_location.city+''
html+=''+数据。当前观察。观察时间+''
html+='';
$(“#temp”).append(html.hide().fadeIn(“慢”);
///现在预测//
var html='';
html+=''+方向+''
html+=‘数据、当前观测值、风速、kph+’数据
目前的观测。天气+数据。当前的观测。天气+数据。当前的观测。当前的观测。目前的观测。目前的观测。目前的观测。目前的观测。感觉就像是U c++的天气+数据。目前的观测。目前的观测。目前的观测。手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手手+数据。当前_观测值。压力_mb+“”
html+='';
$(“#新闻”).append(html.hide().fadeIn(“慢”);
//风//
var html='';
html+=''+方向+''
html+=‘数据、当前观测值、风速、kph+’数据
html+=‘数据、当前观测值、风速、kph+’数据
html+='';
$(“#风”).append(html.hide().fadeIn(“慢”);
///10天///
var dayArray=data.forecast.txt_forecast['forecastday'];
var html='';
对于(var i=0;i