Kevin Basil (signature)

Show Me the Money!

Next article: Keep Your Confederate Dollars, Boys!
Previous article: WiFi? Here?

Written by Basil on 07/9/2002 7:56 PM. Filed under:


Share    
Share with your friends and followers:
Share

At work, I’ve been looking for ways to make our broken intranet pages work with a browser that complies with web standards. Recently, Tim pointed out a bookmarklet that allows the user to toggle styles. It’s pretty groovy, and I was hoping it might allow me to use those unusable pages.

The problem is that these pages rely on the Microsoft Internet Explorer Event model, which conflicts with the DOM Level 2 Event specification published by the World Wide Web Consortium (W3C). They listen for a mouse click event in the wrong place, so in a standards-compliant browser the code to handle that event never gets called. (Forget that they’re hideous beyond repair as HTML.) This means that the content which is hidden, waiting for me to click, just stays in hiding. (Don’t ask me why they hid it. Maybe it was embarassing.) It looks sorta like this, except that I wrote that page to be a standards-compliant version.

Unfortunately, that toggle styles bookmarklet did not go far enough. What I needed was for it to toggle the display properties of the document’s div tags. At first I tried hacking the original bookmarklet, but I quickly realized that toggling the display property on every div leads to a lot of AWOL content. Clearly the Wrong Thing® to do. What I needed was something that set the display property on every div to block.

*** basil does the happy dance ***

Here it is: Show all DIVs. Enjoy.

Share with your friends and followers:
Share


Share   

The URL to trackback this post is:
http://kevinbasil.com/2002/07/09/show-me-the-money/trackback/

Comments are closed.