Mark Baker points to examples of drag and drop using js and css. I feel compelled to give props (um, perhaps even *mad* props, whatever that means) to the dynamic duo -- no, not Batman and Robin, though they definitely occupied a reasonable portion of my childhood brain. No, I am talking about the dynamic duo (aka Dan Steinman and friends).
I learned much of what I understand about [object-oriented] javascript from that site back in 98. I don't even remember how I stumbled across it -- I presume using my favorite search engine at the time... my memory fails. How long ago did you cease to care about anything but google? I remember being religious about hotbot for a while. Ahhhhhh, the good ol' days. Anyway.
Despite having been exposed to Javascript and its OO features, as well as the cross browser challenges and very good approaches for dealing with them circa the evil 4.x days, I don't think I really got javascript in its functional glory until maybe a year and a half ago. It dawned on me when I was trying to implement a script that would globally disable the form inputs (that were either buttons or submits) on a page while the page was posting back to the server. The trick I came up with was to replace the default implementation of __doPostBack (among other things) with my own custom __doPostBack that would perform any validation already assigned to the input and then disable it. This worked for everything but the actual button or link or submit that caused the __doPostBack. That bad boy could not be disabled, because ASP.NET leverages the name of the component to determine what event to map back to. That makes things a little tricky, but the basic user experience was really quite nice and hardly limited to ASP.NET as a reasonable approach.
The magic moment for me (bear in mind that I didn't have a CS background, so I had never seen LISP for real) was when I realized that I could do the following:
var old = __doPostBack;
__doPostBack = function(params) // whatever the params are
{
/*Do the magic here.*/
old(params);
}
Then, add insights like the following, and you start to realize, d-d-d-d-amn, javascript can be pretty cool.
Recent Comments