api get city weather the weather

$ ( Function () {
             var URL = "https://www.tianqiapi.com/api/?version=v1&&cityid=101280301" ; // api request address 
            $ .ajax ({ 
                type: 'GET' , 
                URL: URL, 
                dataType: 'JSON' , 
                the async: to false , 
                Success: function (data) {
                     var Weathers = data.data; // returns the data acquiring content data
                     IF (Weathers && weathers.length> 0 ) // if the value of 
                    { 
                        var weather = weahters [0]; // data interface requests data returned seven days, here taking only the first day of the data 
                    } 
                }, 
                error: function () { 
                } 
            }) 
        });

 

Reference website:

https://blog.csdn.net/qq_38832501/article/details/88384395

http://www.tianqiapi.com/?action=img

https://www.cnblogs.com/emo-Studio/p/6840534.html

 

Guess you like

Origin www.cnblogs.com/JoanLin-workNotes/p/10959003.html