Category Archives: Uncategorized
Aid
b}JZZLk3TZ7ikDHmKN;w6FPCBG&XoN
New Mac configuration
Git git config –global alias.st status
Getting size and position of the scaled element
var el = document.getElementById("main_menu"); var details = el.getBoundingClientRect(); Futher reading: http://ejohn.org/blog/getboundingclientrect-is-awesome/
Difference between element.innerHTML and element.outerHTML
Considering following example: <ul id="menu"> <li>Node 1</li> <li>Node 2</li> </ul> and following code: var el = document.getElementById("menu"); el.innerHTML returns: <li>Node 1</li> <li>Node 2</li> el.outerHTML returns: <ul id="menu"> <li>Node 1</li> <li>Node 2</li> </ul> Suppored in all browsers.
HTML .contains() function
Consider example: var element = document.getElementById("something"); if (document.body.contains(element)) { //do something } Suppored in all browsers.
Difference between .children and .childNodes
Consider following code: <ul> <!– Comment –> <li>Node 1</li> <li>Node 2</li> </ul> .children.length returns 2 but .childNodes.length returns 5 everything is because there are text nodes before, after and between LI elements. Remember that IE 6-8 threats comments as nodes, so children.length in these browsers returns 3 instead of 2. Suppored in all browsers. Similar… Read More »
Quake like console on Mac
TotalTerminal