Tag Archives: xhtml

Disable/Hide Internet Explorer’s Compatibility View Button

If you are an active web developer, you have likely been plagued by Internet Explorer’s Compatibility View button. I have seen so much poor advice about disabling this feature in IE7+. Post after post after post people suggest forcing a specific version for emulation. Haven’t we all learned that allowing IE to dictate how we code a page is a BAD idea?

If you properly code your pages to use standards and a proper document type definition or <!DOCTYPE>, why does IE persist in not doing what it’s told and letting visitors make potentially baddecisions. A user can accidentally click the Compatibility View button or have compatibility mode always enabled by default (OMG!). If you want to make sure IE or the user doesn’t dictate how you code, or how the layout is butchered by compatibility view, add the following to your <head> section…

Continue reading Disable/Hide Internet Explorer’s Compatibility View Button

XHTML compliant external links based on anchor href attribute

The inspiration for this code was New-Window Links in a Standards-Compliant World. They were using the “rel” attribute and checking it for “external” to update the anchor’s target attribute. I lean towards not opening new windows unless it’s an off-site link to improve the user’s experience. Furthermore, I try to avoid adding more code when I can simply use an element’s existing attributes to serve my needs.

Continue reading XHTML compliant external links based on anchor href attribute

PHP/MySQL Nested <select> using <optgroup> with LEFT JOIN on same table in a single query.

I looked around on the web for a while trying to find an example of what I was trying to do. Some were close, but none performed the JOIN portion of the query and on the same table from the SELECT portion (self referencing). So, here is the code I used to created a sub-category only dropdown using the parent categories as the optgroup labels.

Continue reading PHP/MySQL Nested <select> using <optgroup> with LEFT JOIN on same table in a single query.

XHTML Compatible Flash Object Tag for IE7 and FF2

I have been all over the web looking for a good solution that will display a flash movie in both Internet Explorer and Firefox. Most of what I have seen are bloated hacks and workarounds. If we just take a look at the XHTML standards set forth by ther W3C, the answer can be found.

Even though there are many attributes that are considered acceptable by the standards, too many designers are over-complicating the problem at hand. Here is an example of a streamlined object tag that works as expected in most modern browsers.

Continue reading XHTML Compatible Flash Object Tag for IE7 and FF2