按值(value)传递, 但传过来的参数本身是个引用,因此若修改其内部值,原对象便会修改
var a = { b: 1 }
function c(o) { o.b=2 }
function d(o) { o = {} }
c(a) //a = {b:2}
/** | |
* 选取dom元素 | |
*/ | |
var $ = document.querySelectorAll.bind (document); | |
myList = Array.prototype.slice.call (myNodeList); | |
/** |
//Ajax | |
function request(type, url, opts, callback) { | |
var xhr = new XMLHttpRequest(); | |
if (typeof opts === 'function') { | |
callback = opts; | |
opts = null; | |
} | |
xhr.open(type, url); | |
var fd = new FormData(); |
//Ajax | |
function request(type, url, opts, callback) { | |
var xhr = new XMLHttpRequest(); | |
if (typeof opts === 'function') { | |
callback = opts; | |
opts = null; | |
} | |
xhr.open(type, url); | |
var fd = new FormData(); |
// Cross Browser Event Utility | |
// Nicholas Zakas, Professional JavaScript for Web Developers p.441 | |
(function(window, document) { | |
'use strict'; | |
var | |
EventUtil = { | |
addHandler: function( element, type, handler ) { | |
if ( element.addEventListener ) { | |
element.addEventListener ( type, handler, false ); |
/** | |
* SASS 学习记录 | |
* date: 2013-09-03 | |
* author: chengmu | |
* Install: gem install sass | |
* StartWatching: sass --watch style.scss:style.css | |
* features: | |
* 嵌套选择器/样式/伪类(`&`指向父元素) | |
* $定义变量(可用于属性名) | |
* 属性值运算 数值/[辅助函数](http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html) |
//使用express.js+ node.js搭建restful api | |
var express = require('express'); | |
var app = express(); | |
app.use(express.bodyParser()); | |
var quotes = [ | |
{ author : 'Audrey Hepburn', text : "Nothing is impossible, the word itself says 'I'm possible'!"}, |
其实首先是搞下来源码,放进XCode里。。。
光索引就索引了五遍啊简直泣血。。 ###建立xcode项目
源码拷贝到本地
安装gclient(具体参见下文)
切换目录到home/src_tarball/tarball/chromium/
,运行gclient
, 这个会自动更新源码生成xcode项目文件:
$ gclient runhooks
###兼容性
Internet Explorer 8 and 9 are also supported, however, please be aware that many CSS3 properties—e.g., rounded corners and shadows—are not supported by IE8. The placeholder attribute is also not supported in either of these versions.
>In addition, Internet Explorer 8 requires the use of respond.js
to enable media query support.
#GPU & Composting in Blink and Chrome
summaried from Chromium documents and other resources
##Background
###Stacking Contexts Positioned elements(relative, absolute, fixed) with a z-index group of layers into a isolated layer