So you want to trigger an event for a DOM element, without using jQuery? This blog post gives you a quick recipe for doing so.
The running example is about sending a submit event to a form. I needed to do that for a demo of user interface testing via CasperJS. And, unfortunately, the Form#submit method does not send that event on most web engines.
[This post is part of a series on JavaScript quirks.]
Closures are a powerful JavaScript feature: If a function leaves the place where it was created, it still has access to all variables that existed at that place. This blog post explains how closures work and why one has to be careful w.r.t. inadvertent sharing of variables.
Web Components [1] are an upcoming standard for custom HTML5 user interface elements. Those UI elements will eventually become interchangeable between frameworks. Now the people behind AngularJS and Ember.js have described their plans for supporting Web Components.
At Google I/O 2013, Google presented a new web user interface (UI) framework called Polymer. The way it works is indicative of the future of all web UI frameworks.
[This post is part of a series on JavaScript quirks.]
In most programming languages, variables only exist within the block in which they have been declared. In JavaScript, they exist in the complete (innermost) surrounding function:
function func(x) {
console.log(tmp); // undefined
if (x < 0) {
var tmp = 100 - x; // (*)
...
}
}