Apply Dynamic Style to a Class

We recently needed to create an HTML page and dynamically hide/show an entire class of <div> tags that were interspersed throughout the page. Using the getElementsByTagName javascript method, we were able to iterate over all of the <div> elements in the document. Then check the CSS class by accessing the className DOM element:

oDivs = document.getElementsByTagName ( “div” );
for ( d = 0;  d < oDivs.length;  d++ ) {

// cl_name = oDivs[ d ].getAttribute ( “class” ); // does NOT work in IE
cl_name = oDivs[ d ].className;
if ( cl_name == “bio” ) {

oDivs[ d ].style.display = “none”;

}

}

Note that the getAttribute method does not work in IE since class is a reserved word for IE. Took us a little while to figure that one out.

HttpFox

Recently we had to troubleshoot an Internet Explorer problem with a force download ASPX script. The download script was being called from a Flash movie. After the call to the download script, all outgoing Javascript calls from Flash were either loading in the Address Bar and not being executed as Javascript (IE6) or were throwing errors (IE7).

It was a black box situation where we only had HTTP access to the server. We needed to examine the HTTP headers to determine if they were a contributing factor to the issue. But how? We found this clever Firefox Add-on that did the trick: HttpFox

Postie

We just found a really neat-o plug-in for WordPress called “Postie”. It enables you to send email messages that get posted to your blog. Any video or image attachments are also included in the post. We tried sending snapshots from our cellphone to Postie and it works like a charm. Check it out here: postie.economysizegeek.com

Hello World!

We installed and skinned WordPress a couple times for blog-hungry clients in the past year and liked it so much we decided we wanted one of our own. Welcome to the new WordPress powered iteration of Underblob: V3.

Cheers!

Errands with Butter

I went out to run errands this morning. I walked up Kent Avenue to N 7th Street to Bedford to N 4th Street to the King’s Pharmacy. I dropped of a prescription for a new set of balls. Afterwards, I stopped in the bagel place near 7th and Bedford to get a buttered sesame bagel and iced coffee. Mmm yummy. I walked back to Greenpoint, eating my bagel, drinking my coffee. I passed Eric the painter on the sidewalk on Wythe Avenue. He didn’t look angry today and seemed to even have a spring in his step. He looked away when he got close enough to question if I looked familiar or not. I see that dude all the time in Greenpoint. He never recognizes me. Or maybe he recognizes me and pretends not to. Or maybe we just have a mutual apathy for each other. It’s just weird that I see him all the time. I guess not so weird… we do live in the same neighborhood. I also passed my mailman on the street. He is a wiry little Chinese man with no front teeth. He grinned his toothless grin at me but did not reply when I said “Good morning”. I went to the Radio Shack and spoke at length with a saleswoman about DSL splitters. I purchased one. She thought I was making a bad decision and reassured me that I could come back and get a refund for up to 30 days after the purchase. I went to the grocery and got some juice and paper and some grapes. The Polish cashiers there never make eye contact and never reply when you say “Hello” or “Thank you”. On my way back to the apartment, coming up the stairs of the stoop outside the building, I noticed a small light-colored blemish on the glass of the vestibule doors. Hmm. Wait. It’s not on the glass, it’s on the reflection in the glass. Oh shit, it’s on my face. Oh shit, it’s a well-buttered sesame seed.