jQuery-get请求

url = 'xxxxxx'

1. 发起get请求

 // 1.url地址  2请求成功后执行的函数(data,status,xhr)
            $.getJSON(url,function (data,status,xhr) {
                console.log(data)
                $('p').text(data.date)
                // 取出数据字典
                rs_data = data.results[0]
                $('h1').text(rs_data.currentCity)
            })

        })

猜你喜欢

转载自blog.csdn.net/qq_41664526/article/details/80287047