Remove All Children!
When searching for an easy method to remove all of a node’s children in JavaScript, I really need to remember to include the search term “JavaScript”.
Add comment October 22nd, 2009
When searching for an easy method to remove all of a node’s children in JavaScript, I really need to remember to include the search term “JavaScript”.
Add comment October 22nd, 2009
Something I want to know just infrequently enough. How is it done? How do I know, if I’ve got an element with “overflow:auto”, if it’s generated the scrollbar? And why do I want to know?
This is a handy technique when trying to, for instance, truncate unwieldy text within a fixed space. The trick?
Compare the element’s clientWidth (or clientHeight) to it’s scrollWidth (or scrollHeight). If the scrollWidth > clientWidth, the element has gone off the edge. Voila! Hopefully next time I need to remember this, I remember where I wrote it down.
Add comment December 11th, 2008
Internet Explorer is ever the fussy browser.
Sometimes you don’t have control over a whole page but you don’t want to endlessly define repetitive inline styles, so you create a <STYLE> section and away you go! It works just fine in any other modern browser, but IE, at least as of IE7, will refuse to see it. The solution? Import the CSS file with JavaScript, and append it to the header yourself. A bit counterintuitive, but it works.

The second thing that I needed to do was to show and hide a form element, which is pretty straightforward– just use JavaScript to set the style.display property of the given object, and away you go, right? Well, sort of. If I set foo.style.display = “none” in IE, it works as expected and hides the element. But, the moment that I try to set that style to anything else to show the element again– “table-row”, for instance– the whole thing goes crazy and breaks. The answer? $(“foo”).style.display = “”. The empty string makes it all happy.
Add comment August 7th, 2008
I mostly use MySpace as a place where old friends and enemies alike can hunt me down with surprising ease, but once in a while– generally on the order of a few times a week– I get MySpace spam too, scantily clad “real girls” advertising some online hookup service or another.
Usually they’re pretty dull, but sometimes you come across something that just makes you smile. To wit:

Obviously, we’re soul mates.
2 comments March 25th, 2008
Marc Liyanage’s site, and his PHP for OS X package, in particular, rock. So now that I have a new little laptop– zoom!– I need to set up a new PHP/MySQL install, so I can GBTW.
Unfortunately, it seems that the last couple of times I’ve set up a new install of PHP 5, and I’ll get the database all up and running, I go to log in to the index page of some new project and… it fails. I get stuck, flailing, at the login page. It will tell me if I’ve entered an invalid login, but it will not go any further!
This is at least the second time I’ve done this, and you think I would have remembered the first time, but the answer seems to be in this line in the php.ini file:
session.auto_start = 1
Maybe that will help someone else someday. Maybe if nothing else, it will help me next time I stumble over this.
Add comment February 21st, 2007
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Aug | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | |||