↧
Currying in Javascript
Javascript has somewhat strange scoping rules that can catch you unaware. Here’s a typical example: function test() { for (var i = 0; i < 5; i++) { setTimeout(function() { console.log(i); }, 1000);...
View ArticleDOM text search/replace with jQuery
I recently did a quick hack to modify a bunch of text (phrases) on an already rendered HTML page. It was inconvenient to manually select single elements and modify the text – what I needed was a global...
View ArticleHTML input placeholder handling with jQuery
There’s a million of small jQuery snippets which handle input placeholders (ie. the help/explanation text that’s shown until you actually write something in the field), and when HTML5 gets widespread,...
View Article