与服务器通讯 目前主流的方法: Ajax: 方便快捷 JQuery太大,引入两个库 axios: 返回承诺,易于分离 并发请求 promise.all( 1 2 ) fetch: 比较底层,需要二次封装 原生跨域 Jquery老迈笨拙,fetch年轻稚嫩,只有Axios正当其年! get请求 axios.get('url') .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); post请求 axios.post('url', data) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); });