Why I never wrote this function before is a mystery.
Continue reading “Javascript: getElementById() for XML fragments and arbitrary XML documents + getElementsByAttribute()”
The joy of… JavaScript’s getElementsByTagName()
For what it’s worth the kernel of this article was dictated into my phone on my drive into work this morning. I got the idea, had the framework and figured- why the hell not just talk to myself for a while. It was actually pretty efficient, so I might do more of it and if I get good enough at this sort of extemporaneous dictation I might turn it into a podcast 🙂
Continue reading “The joy of… JavaScript’s getElementsByTagName()”
Cross Browser PNG Transparency: Part 2
In October, I posted about cross browser PNGs. Since IE7’s adoption rate is glacially slow, the topic is still relevant. That it’s still relevant is also evidenced by the number of referrals I get on this topic- People are interested in doing this stuff.
Continue reading “Cross Browser PNG Transparency: Part 2”
Need/Want to Hide Internet Explorer 6 Specific JavaScript from IE7?
I use conditional comments to hide IE6 specific styles and scripts from IE7 (and IE7 specific styles and scripts from other browsers), but sometimes you need a bit of logic or something to only run on IE6 and earlier. Conditional compilation is a pretty foolproof way to handle that.
function ie_function() {
/*@cc_on @*/
/*@if (@_jscript_version < 5.7)
do_ie_6_stuff()
/*@end @*/
}
the @cc_on
block turns on conditional compile. Since it’s wrapped in a comment block every other browser just ignores it. The next line (@if (@_jscript_version < 5.7)
) tests for the specific JScript version present in IE7. If it’s there, nothing else happens. Otherwise the code on the next line is run. Wicked. Flip the comparison operator to >= and you’ve got a foolproof test for IE7. Double wicked.
Code : Javascript : Turn a block into a clickable link area.
Here’s a little script (and some CSS) that turns an entire block (in this case a TR) into a click-able item:
Continue reading “Code : Javascript : Turn a block into a clickable link area.”