<email ⁄>
<windows live messenger ⁄>
<myCurriculum type="pdf" ⁄>
Readers of my blog probably know that I'm a bit into functional programming languages (F#, Erlang, Clojure, Haskell, etc) among other topics, but what you may not know is that I'm a huge JavaScript fan as well. Since I began in the industry (professionally anyways), I've been using JavaScript to knock out some pretty interesting solutions. Over the years, many people have tried to abstract over the language, taking such approaches as taking a statically typed language and compiling it to JavaScript, but when it comes down to it, I prefer dealing with the natural language of the web, which is HTML, CSS and native JavaScript.
As much as I love the JavaScript language, it has its set of warts primarily from DOM manipulation.
The Problem with JavaScript Eventing
One of the issues around DOM manipulation has been around DOM Events. The inconsistencies between the browsers were apparent, but just as well, how could you make events composable much as your would say functions? For example, how could I do a simple mouse drag over a div which gathers not only the current value but also the previous? We'd need some sort of global state, e.g. the previous mouse location. Below is a quick example using plain old JavaScript without the aid of any libraries like jQuery, etc.
este é só um excerto do artigo, para aceder ao artigo completo, clique no link em baixo:
this is just a small excerpt from the article, to access the full article please click in the link below:
http://weblogs.asp.net/podwysocki/archive/2010/02/16/introduction-to-t...