Every once in a while I stumble upon an API or browser setting that I can't believe ever existed. Such examples can be seen in the numerous
String.prototype properties such as
italics, and even
blink, which wrap given string text in their representative HTML tags. Bizarre.
It was recently brought to my attention the
document.designMode API: an
on|off switch that acts almost like a
contentEdible attribute for the entire document. You can toggle
designMode by simply changing the setting:
document.designMode = "on";
designMode setting on, you can edit page text, drag and drop assets, and generally cause chaos on the page. This is really nice for prototyping; I'd have loved to have known about this while doing client work.
While I see uses for this API, it does feel a bit bizarre. I'd have liked to have known the origins of this property and its use cases. Have ideas about how you'd use it? Share!
My first professional web development was at a small print shop where I sat in a windowless cubical all day. I suffered that boxed in environment for almost five years before I was able to find a remote job where I worked from home. The first...
jQuery offers a quick event shortcut method called hover that accepts two functions that represent mouseover and mouseout actions. Here's how to implement that for MooTools Elements.
We implement hover() which accepts to functions; one will be called on mouseenter and the other...