作为一个懒人,在JS . 和 []之间总是选择.,今天查资料时,倒是看到了 “点” 和 “括号”的一些区别。这里抛砖引玉一下
先看一个常见例子:1
2
3
4
5var obj = { "say" : "hello" };
var x = "say";
var y = obj[x];
console.log(y); // hello
obj.x // undefine
作为一个懒人,在JS . 和 []之间总是选择.,今天查资料时,倒是看到了 “点” 和 “括号”的一些区别。这里抛砖引玉一下
先看一个常见例子:1
2
3
4
5var obj = { "say" : "hello" };
var x = "say";
var y = obj[x];
console.log(y); // hello
obj.x // undefine
在上次的项目中有提到,上传文件时,要将contentType和processData都设置为false,现在给出我的理解(轻拍
contentType (default: ‘application/x-www-form-urlencoded; charset=UTF-8’)
When sending data to the server, use this content type. Default is “application/x-www-form-urlencoded; charset=UTF-8”, which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent).
这是一个比较简单的全栈Demo,写这个的动机主要是:当我查询网上一些nodejs资料时,很少有完整的传输文件的案例,大多是通过前端form 的action属性直接上传,所以萌生了写通过FromData上传图片的案例。功能实现之后做了一些前端展示。算是个比较不错的入门全栈项目。
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
1 | $ hexo new "My New Post" |
More info: Writing
1 | $ hexo server |
More info: Server
1 | $ hexo generate |
More info: Generating
1 | $ hexo deploy |
More info: Deployment