开发备忘录

//需要研究内容,

后台启动跨域等配置

//设置跨域访问
app.all('*', function(req, res, next) {
    if( req.headers.origin == 'http://localhost:8080' || req.headers.origin == 'http://marszm.cn' ){
        res.header("Access-Control-Allow-Origin", req.headers.origin);
    }
    // res.header("Access-Control-Allow-Origin", 'http://localhost:8080');
    // res.header("Access-Control-Allow-Origin", '*');
    res.header("Access-Control-Allow-Credentials",true);
    res.header("Access-Control-Allow-Headers", "*");
    res.header("Access-Control-Allow-Headers", "X-Requested-With");
    res.header("Access-Control-Allow-Headers", "Content-Type,Access-Token");
    res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
    res.header("X-Powered-By",' 3.2.1')
    next();
});

JQuery 1.9.1 源代码 :web

JQuery插件写法  | js define用法  | $.data()的作用和理解

继续阅读“开发备忘录”

深入浅出Node.JS 读书笔记

2018-2-12

1.书里一直在说I/O,我就很想知道具体的定义是读写还是网络请求处理。搜了一圈,都是在讲异步I/O,阻塞,非阻塞什么的。还好Node的官网有说。

“I/O” refers primarily to interaction with the system’s disk and network supported by libuv.

https://nodejs.org/en/docs/guides/blocking-vs-non-blocking/

libuv定义的I/O是说,系统的数据读写和网络支持交互。