Hexo


  • 首页

  • 分类

  • 关于

  • 归档

  • 标签

关于 [] 和 .(点dot) 的杂谈

发表于 2017-12-17

作为一个懒人,在JS . 和 []之间总是选择.,今天查资料时,倒是看到了 “点” 和 “括号”的一些区别。这里抛砖引玉一下

先看一个常见例子:

1
2
3
4
5
var obj = { "say" : "hello" };
var x = "say";
var y = obj[x];
console.log(y); // hello
obj.x // undefine

阅读全文 »

浅谈Ajax中的contentType和processData

发表于 2017-12-15

contentType

在上次的项目中有提到,上传文件时,要将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).

阅读全文 »

Nodejs 图片上传及回显

发表于 2017-12-15

写在前面

这是一个比较简单的全栈Demo,写这个的动机主要是:当我查询网上一些nodejs资料时,很少有完整的传输文件的案例,大多是通过前端form 的action属性直接上传,所以萌生了写通过FromData上传图片的案例。功能实现之后做了一些前端展示。算是个比较不错的入门全栈项目。

阅读全文 »

first post

发表于 2017-12-12

Hello World

发表于 2017-12-12

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.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

12
Daniel Chen

Daniel Chen

15 日志
8 标签
© 2018 Daniel Chen
由 Hexo 强力驱动
主题 - NexT.Muse