JavaScript 快速入门
发送HTTP请求
原生API
Ajax XMLHttpRequest
$.ajax
fetch
Axios
Angular HttpClient
XMLHttpRequest
SuperAgent
Ky
...
jQuery发送Ajax请求
数据格式
字符串
JSON
$.ajax()
jQuery中Ajax系列方法之母
javascript
$.ajax({
url: "", //链接地址,字符串表示
data: "", // 发送到服务器的数据
type: "GET/POST",
timeout: 500, // 500ms
cache: false, //是否缓存请求结果,bool表示
contentType: "", // 内容类型,默认为"application/x-www-form-urlencoded"
dataType: "json", // 服务器响应的数据类型
success: "",// 请求成功后,回调的函数
error: "", // 请求失败后,回调的函数
complete: "", //请求完成后调用的函数,无论请求是成功还是失败,都会调用该函数
async: true, //是否异步处理
username: "", // 访问认证请求中携带的用户名,字符串表示
password: "", // 访问认证请求中携带的密码,字符串表示
})$.post()
javascript
// $.post(url, data, func, dataType);
$.post(
"url", // url:链接地址,字符串表示
{name: "bookName"}, // data: 发送到服务器的数据
function (data){ // func:请求成功后,服务器回调的函数
},
"json" // dataType:服务器返回数据的格式
)$.get()
javascript
// $.get(url, data, func, dataType);
$.get(
"url", // url:链接地址,字符串表示
{name: "bookName"}, // data: 发送到服务器的数据
function (data){ // func:请求成功后,服务器回调的函数
},
"json" // dataType:服务器返回数据的格式
)$.getJSON()
javascript
// $.getJSON(url, data, func);
$.getJSON(
"url", // url:链接地址,字符串表示
{name: "bookName"}, // data: 发送到服务器的数据
function (data){ // func:请求成功后,服务器回调的函数
}
)解构赋值
JSON 和 JS 对象的异同
JavaScript对象、JSON对象、JSON字符串的区别
Fetch跨域
资源推荐
官方
JavaScript Strings: The Basic Methods and Functions | JavaScript.com
在线教程
JavaScript | web.dev for China
文档规范
ECMAScript® 2026 Language Specification
项目推荐
- next.js
- react
- javascript-algorithms
- material-ui
- axios
- node
- learnGitBranching
- freeCodeCamp
- vue
- Rocket.Chat
- joplin
- nodebestpractices
- NeteaseCloudMusicApi
- vant-weapp
- bootstrap
- cypress
- Realworld
- javascript
- react-router
- markdown-here
- react-virtualized
- lighthouse
- Gatsby
- puppeteer
- leetcode
- awesome-mac
- wangEditor
- jitsi-meet
- lx-music-desktop
https://github.com/YUUXIAO/webProject
https://github.com/30-seconds/30-seconds-of-code
https://github.com/leonardomso/33-js-concepts
https://github.com/lydiahallie/javascript-questions
https://github.com/wesbos/JavaScript30
https://wangdoc.com/javascript/
https://developer.mozilla.org/zh-CN/
https://github.com/ryanmcdermott/clean-code-javascript
https://www.w3school.com.cn/js/index.asp
https://zuoye.blog.csdn.net/article/details/126079743)
https://github.com/docsifyjs/docsify