Node isConnected
Every so often I discover a property in JavaScript objects that I didn't know existed, oftentimes using another trick to accomplish the same functionality. One such property I just learned about was isConnected
, a node property that attached to a context (i.e. document
).
Here's how to use Node.prototype.isConnected
:
const el = document.createElement('div');
el.isConnected; // false
document.body.appendChild(el);
el.isConnected; // true
I used to run parentNode
checks on the element to see if it had been injected but that's not always accurate, so I'm glad isConnected
exists!
Firefox OS is all over the tech news and for good reason: Mozilla's finally given web developers the platform that they need to create apps the way they've been creating them for years -- with CSS, HTML, and JavaScript. Firefox OS has been rapidly improving...
One of my favorite social APIs was the Open Graph API adopted by Facebook. Adding just a few META tags to each page allowed links to my article to be styled and presented the way I wanted them to, giving me a bit of control...
I wouldn't say that I'm addicted to checking Google Analytics but I do check my statistics often. I guess hoping for a huge burst of traffic from some unknown source. Anyway, I have multiple sites set up within my account. The way to...
I released a MooTools comment preview script yesterday and got numerous requests for a jQuery version. Ask and you shall receive! I'll use the exact same CSS and HTML as yesterday.
The XHTML
The CSS
The jQuery JavaScript
On the keypress and blur events, we validate and...