API:API(Application Programming Interface,应用程序编程接口)是一些预先定义的函数,目的是提供应用程序与开发人员基于某软件或硬件得以访问一组例程的能力,而又无需访问源码,或理解内部工作机制的细节。——百度百科
补充:XML(可扩展标记语言,存储和传输数据,现被json取代)而 HTML是呈现数据.
Ajax全称:Asynchronous JavaScript and XML(异步的JavaScript和XML)
Ajax特点:在网页不刷新的情况下,向服务端发起http请求,然后得到http响应.(登陆页面不刷新显示账号情况,百度搜索某内容会出现对应相干内容,商品二级目录交互显示一级目录等)
http:超文本传输协议(英文:Hyper Text Transfer Protocol)
搭建json-server
GitHub - typicode/json-server: Get a full fake REST API with zero coding in less than 30 seconds (seriously)https://github.com/typicode/json-server
axios配置
GitHub - axios/axios: Promise based HTTP client for the browser and node.jsPromise based HTTP client for the browser and node.js - axios/axioshttps://github.com/axios/axios
axios:get: