Sans jQuery
Events
// jQuery
$(document).ready(function() {
// code
})
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDFbcTbSIYZ30FJCw3eXOYFKB9XDy1l9Hv2ETxE7xn+8IHiflLm3DYb0mF0Shhaouj3E6QXIduh9IDhUjt75L1KOp+YF73WMmylm1IBu2ZL+9e76TrUVlZNEqDlCvjugntiyxtUqYpAyPWXVpaRLxsyy07XV6uvjyLEO8EhOb0gCiIoodmmwP5neHslcntFvUGsb0vYNO56kBwFBrEv7x+rRRaV6tRsGSyITkALb55BbwaLWPsyUoa11hU48GGT56ZkKBETxfi5pFY2WUlLoHt+qyty+Bfh+1EVi+y+gIA/rqYhyIJZkyiaJPGHpk+TkYS9sFAsxMRWH6nC9p/JxNYmDOGoapH9hV3tn2JvUwXsORREpfvxYhY1w2CMSUw4/YuAgzZVX7XhcijK68vKwH5RtA3ued75IfBurzxNCh/+WavYFbi0t33qSE3xYgU9QGEjIm5gDFf7PwLZI0Gf4ArKijzWqf6o3mhSGrFa6yPX45MdOQ58QNON5bW4nsbXLLc= jhon@jhon-lenovo |
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, |
license: mit |
var val = undefined | |
if(val === undefined || val === null) { | |
//do something | |
} | |
if(val == undefined) { | |
//do something | |
} |
if(num === 10 || num === "10") { | |
//do someting | |
} | |
if(num == 10) { | |
//do someting | |
} |
function doImportantStuff() { | |
//function scope | |
var someVariable = "important stuff"; | |
} | |
{ | |
//block scope | |
let anotherVariable = "not so important"; | |
} |
function doImportantStuff() { | |
var someVariable = "important stuff"; | |
console.log(someVariable); // "important stuff" | |
console.log(anotherVariable); // oops can't access that | |
} | |
function anotherImportantStuff() { | |
var anotherVariable = "not so important"; | |
} |
function doImportantStuff() { | |
var someVariable = "important stuff"; | |
function reportImportantStuff() { | |
console.log(someVariable) // "important stuff" | |
} | |
reportImportantStuff(); | |
} |
// jQuery
$(document).ready(function() {
// code
})
for( var x=0; x<3; x++){ | |
for( var y=3; y>0; y--){ | |
console.log( y*x); | |
} | |
} | |
//initiate x with 0 | |
//check x < 3 if we can proceed | |
//if so, do the inner loop | |
//initiate y to 3 | |
//check y > 0 if we can proceed |