
Ajax
前端Beginners
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
jQuery中Ajax的基本使用
**get请求:**$.get(URL,传递的参数,回调函数)$.get('http://127.0.0.1/server',{a:100,b:200},function(){....})**post请求:**(与get请求是一样的)$.post(URL,传递的参数,回调函数)$.post('http://127.0.0.1/server',{a:100,b:200},function(){....})还可以加第四个参数:(设置响应体的数据类型)$.get(‘http://原创 2021-05-20 09:54:55 · 114 阅读 · 0 评论 -
Ajax基本使用
由于Ajax是基于node的环境下进行的,所以我们在使用前先有确保已经下载node同时我们还需要进行下载express $ npm i express在script标签下进行书写const xhr = new XMLHttpRequest(); //设置请求方法和URL xhr.open('GET', 'http://127.0.0.1:3000/server'); //请求发送 xhr.send(); //事件绑定 处理服务端返回的结果 //on原创 2021-05-18 10:35:37 · 135 阅读 · 0 评论