摘要:
npm install -g cnpm --registry=https://registry.npm.taobao.org 阅读全文
摘要:
! mongodb注意点:数据表名称一定要用复数,比如users,在使用model引用时也必须复数 阅读全文
摘要:
添加依赖到package.json 实时刷新 删除文件/文件夹 linux 删除某类型文件 阅读全文
摘要:
/*common*/ body{ color:#666666; font-size:12px; margin:0; padding:0; font-family:"Arial","Microsoft YaHei"; } form,ul,li,p,h1,h2,h3,h4,h5,h6,img,em,i,strong,input{ margin:0; ... 阅读全文
摘要:
Learn React & Webpack by building the Hacker News front page from https://github.com/theJian/build-a-hn-front-page 1.安装nodejs 2.安装webpack 3.安装webpack- 阅读全文
摘要:
Jsonp.html JsonpS.js 另:CORS跨域请求 http://blog.csdn.net/fdipzone/article/details/46390573/ 阅读全文
摘要:
var jsonData = {a:1,b:2}; function obj2string(o) { var r = []; if (typeof o == "string") { return "\"" + o.replace(/([\'\"\\])/g, "\\$1").replace(/(\n)/g, "\\n").replace(/(\r)/g, "\\... 阅读全文
摘要:
cross_sub.html sub.html http://a.test.com/sub.html 发起请求,通过提升域和引入iframe的方式,获取iframe子域中所请求接收的数据。 阅读全文
摘要:
1.Vimium 阅读全文
摘要:
1.Package Control 安装插件 2.Material Theme 主题 3.Emmet 自动HTML标签 4.Snippets JS自动片段 5.Advance newfile 文件夹下新建 6.DocBlockr 注释 7.SublimeLinter JS语法校验 8.Nettuts 阅读全文
摘要:
测试网址:www.regexper.com www.jsbin.com 例:匹配数字类型(正整数和小数) var reg = /^\d+\.?\d*$/ string.match(reg); //true or false; 标记速记: . 任意字符 除回车换行 \d 数字 ? 0个或者1个 + 1 阅读全文
摘要:
我是一个居中的文档框 nodejs在调用某个包时,会检查包中package.json文件的main字段,将其作为包的接口模块,如果package.json或main字段不存在,会尝试寻找index.js或index.code作为包... 阅读全文
摘要:
var g = function(str){ if(str.substr(0,1)==="."){ return document.getElementsByClassName(str.substr(1)); }else if(str.substr(0,1)==="#"){ return document.getElementById(st... 阅读全文
该文被密码保护。 阅读全文
摘要:
html css js json 阅读全文
摘要:
一、数据类型 1.原始类型:number、string、boolean、null、undefined 2.对象类型:Object (Function、Array、Date...) P.类型隐式转换:'32'-2=30 //自动将字符串32转换为数字32 P.==和 : '1.23'==1.23,0= 阅读全文
摘要:
nodejs概念: 让javascript运行在服务端的开发平台。不是一种语言,不是框架,不是库。特点:单线程异步、事件驱动。 PHP、JAVA既是语言也是平台。 创始人:Ryan nodejs cmd 命令: node -v //查看nodejs版本 node -e "console.log('o 阅读全文
摘要:
var EventEmitter = require("events").EventEmitter var event = new EventEmitter() event.on("some_event",function(){ console.log("I'm a event") }) setTimeout(function(){ event.emit("some_event"... 阅读全文
摘要:
var fs = require("fs") fs.readFile("file.txt","UTF-8",function(err,data){ if(err){ console.log("err") }else{ console.log(data) } }) console.log("end"); 阅读全文