Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
// the file is split and uploaded in chunks via multiple XHR requests | |
/* | |
Slicing large file uploads is a good technique to provide more robust | |
API where connectivity is unstable or intermittent—e.g., if a chunk | |
fails due to dropped connection, the application can retry, or resume | |
the upload later instead of restarting the full transfer from the start. | |
*/ | |
var blob = []; |
// 类继承模式 uber 存储超类 | |
function inherit(C, P) { | |
var F = function(){}; | |
F.prototype = P.prototype; | |
C.prototype = new F(); | |
C.uber = P.prototype; | |
C.prototype.constructor = C; | |
} |
/* | |
Array generic methods | |
These are currently not part of ECMAScript standards (though the ES6 Array.from() can be used to achieve this). | |
The following is a shim to allow its use in all browsers: | |
src: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array | |
*/ | |
(function () { | |
'use strict'; |
// script 1 | |
var img = document.getElementById('image1'); | |
img.addEventListener('load', function() { | |
// loaded handing | |
}) | |
img.addEventListener('error', function() { | |
// error handing | |
}) |
#autoresize { | |
resize: none; | |
outline: none; | |
width: 300px; | |
word-break: break-all; | |
font-family:sans-serif; | |
font-size: 1em; | |
line-height: 1.2em; | |
margin: 0px; | |
} |
// 页面加载完成后调用方法 | |
function addLoadEvent(func) { | |
var oldonload = window.onload; | |
if (typeof oldonload !== 'function') { | |
window.onload = func; | |
} else { | |
window.onload = function() { | |
oldonload(); | |
func(); |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
[ | |
{ | |
name:"HTML5", | |
uri:"http://www.w3.org/TR/html5/single-page.html", | |
category:"markup" | |
}, | |
{ | |
name:"HTML 5.1", | |
uri:"http://www.w3.org/TR/html51/single-page.html", | |
category:"markup" |