Snippet – how to calculate the total height of the document with JavaScript


I needed for a project, I’m working on to calculate the total height of the document, not just the height of the visible view or of a particular element.

Leggi Articolo

Bookmark: image resizing in JavaScript


On Mozilla Hacks: (using canvas) Jose Frichter (Lanczos resizing) Canvas and Lanczos resizing Enzo Moretti (Using Web Workers for Lanczos resizing)

Leggi Articolo

Use of the native javascript forEach


The forEach method in JavaScript is a standard from the new ECMA5 script specifications. It can be used as it is if the applied to a node list, such as something returned from a function like document.querySelectorAll(”) or document.getElementById(‘id’). The whole point of this trick it’s this one:

Leggi Articolo

JavaScript best practices


When you work in a large project all the developers should write code readable and that look like written by one person only. If this doesn’t happen the result is that other developers have to spend time trying to understand your unconventional way of coding. For coding correctly I don’t just mean adding comments to the code, but avoid for example intrusive JavaScript. Another advantage of that is […]

Leggi Articolo