Skip to content

Commit

Permalink
add ajax content
Browse files Browse the repository at this point in the history
  • Loading branch information
SakuraMuxia committed Apr 29, 2024
1 parent f23d761 commit f74e59c
Show file tree
Hide file tree
Showing 5 changed files with 733 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default defineConfig({
},
{
text: 'Ajax',
link: '/front-end/'
link: '/front-end/07-ajax/'
},
{
text: 'Promise',
Expand Down Expand Up @@ -162,6 +162,7 @@ sidebar: {
"/front-end/04-ES6/": set_sidebar("/docs/front-end/04-ES6/"),
"/front-end/05-Node.js/": set_sidebar("/docs/front-end/05-Node.js/"),
"/front-end/06-mongoDB/": set_sidebar("/docs/front-end/06-mongoDB/"),
"/front-end/07-ajax/": set_sidebar("/docs/front-end/07-ajax/"),
"/blogs/01-technology/": set_sidebar("/docs/blogs/01-technology/"),
"/devops/git/": set_sidebar("/docs/devops/git/"),
},
Expand Down
11 changes: 11 additions & 0 deletions docs/front-end/01-HTML5CSS3/02-HTML功能标签.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,17 @@ colspan: 设置所跨列数
<input type="text" maxlength="10">
```

当类型为file时为上传文件

```html
<form action="/upload" method="post" enctype="multipart/form-data">
<input type="file" name="avator">
<button>上传</button>
</form>
```



#### 密码输入框

```html
Expand Down
13 changes: 13 additions & 0 deletions docs/front-end/05-Node.js/07-express.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ body-parser包中间件 可以把req.body中的数据解析转为对象
express-generator包 自带body-parser可以把req.body中的数据自动解析为对象
mongoose包自带body-parser可以把req.body中的数据自动解析为对象

表单发送的content-type类型是application/x-www-form-urlencoded解析为对象
默认发送的content-type类型是text/plain源格式还是字符串。
```

```js
Expand Down Expand Up @@ -525,3 +527,14 @@ data.json
]
```

设置响应体为json格式

```json
// 响应一个json数据
res.json({
code: '1001',
msg: '读取失败~~',
data: null
});
```

Loading

0 comments on commit f74e59c

Please sign in to comment.