Traditional Culture Encyclopedia - Weather inquiry - Why does appcan.request.get suddenly stop working?
Why does appcan.request.get suddenly stop working?
Please check whether the data returned by the interface can pass json verification. Our method is to call JSON.parse for conversion.
Function updateInfo (city, ele){
var weather URL = '/telematics/v3/weather? Location ='+City+'&; Output = JSON & AMPAK = htxrttggcljoomdf2Jzcc1yd';
app can . request . get JSON(weather URL,function(data){
if(data.error){
Alert ("Error in getting the weather");
} Otherwise {
var weatherData = data.results[0]。 Weather _ data;
var today = weather data[0];
$(ele)。 Find ('. lis-icon-s’)。 css('background-image ',' URL(" '+today . daypictureurl+'));
}
});
}
This is the test code for calling Baidu api, no problem. I also wrote a test demonstration in php. No problem. Php code:
& lt? Server-side programming language (abbreviation of professional hypertext preprocessor)
echo“{ a”:“b”}”;
& gt
- Related articles
- 2065438+021What's the weather like in Shenzhen on October 4th?
- "6" Landslide Disaster in WU GANG Town, Guanling, Guizhou Province
- How long does Pokemon xy refresh when it rains?
- 5 important geographical news! @
- Detailed explanation of Dunhuang tourism: Dunhuang tourism routes
- Why are all F1 safety cars Mercedes-Benz?
- The world distribution range and characteristics of various climate types
- Yanbian Satellite TV! ! !
- Idioms indicating bad weather
- Vicissitudes, Great Changes, New Faces | Capital Cangzhou >>& gt Look East