Welcome to the Personal Website of George Michael Huff
Building it Strict - XHTML Compliance
By George Huff
I had to jump through numerous hoops to get this site to be of strict compliance. I figured I would share to get some dialogue going about different techniques that others have used as well as my own.
Although this list is published, I may add more to it in the future, just because this stuff never ends.
Before the list though, I would like to thank Steve James over at epicunion for keeping me up to date on the good, the bad, and the ugly of web standards. Everytime I think I can teach him something, he ends up teaching me.
Please comment on this post if you have any feelings towards any of it.
1. The “target” attribute I feel the target=”_blank” function isn’t as obsolete as the w3c would have us believe. In all practical respects, most websites do not want to direct traffic away from their sites. While it is nice I have a flickr picture gallery feed coming to my site, I do not want to send all of my traffic from my site to flickr. With tab browsing becoming the norm (with the release of IE7 of course) links opening new tabs is not the annoyance that it once may have been. With that being said, here is the first hoop:
Strict XHTML does not allow the “target” attribute within a tags. Now, by no means did I come up with this solution, I found it here. There are far brighter folks than me kickin it on the web and I can only express my gratitude for them to share their solutions. Moving on..
Instead of using target=”_blank” one must use rel=”external”. But the fun doesn’t stop there, one also needs to include a JavaScript file on every page that looks like this.
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute(”href”) &&
anchor.getAttribute(”rel”) == “external”)
anchor.target = “_blank”;
}
}
window.onload = externalLinks;
All in all, it’s a great solution to a problem, that I feel, shouldn’t exist. But that’s just me.
2. Feeds Compliance - I listed my feeds on every page with contact information. When I went to validate my code, I found the W3C really didn’t like my flickr feed. The workaround:
I opened a FeedBurner account and ran my feeds through them. Upon which, I also now have tracking for my RSS feeds. I am still not totally convinced of the accuracy of FeedBurner, but I really appreciate their effort to provide this as a limited service for free.
This particular problem brings up the lack of effort from many of the cool “web 2.0″ companies to bring their services up to standards. While I understand they are focused on their service, it would be nice to see a little more love shown to the standards community.
3. YouTube Embed - Yet to be solved. James over at The Good Harvest, is tackling the problem. More flash wizardry to come.
4 Building good clean XHTML and CSS - More important than anything I have mentioned is to practice good coding. Think about what you are doing before you do it. I am not claiming to have perfect code, but I am claiming that is what I stive for. If you care to take it there, I am more than open to suggestions on my own coding practices. Always learning…
Popularity: 9% [?]
Comments for Building it Strict - XHTML Compliance
You Say about Building it Strict - XHTML Compliance
Recent Entries
Welcome to the Website of Eleven3. I like to build clean websites, period.
This Is George Huff
He is a web designer / entrepreneur / conspirator / blogger / fianceé living in Portland, Oregon.
When not fully immersed building websites, he runs a record label, writes music, throws a music festival, grows vegetables, and happens to be a huge advocate of his friends and family.
Currently My Latest Twitter
it's slowly turning into a work night. Gotta say it is going to be tough getting anything done on a Sunday for awhile. 5 hrs ago Follow Me
Featured Work My Portfolio
Topics You've made it this far
- Alaska
- Apple
- Applications
- Browsers
- Business
- CMS(s)
- Community
- Conferences
- CSS
- Education
- Freelance
- General
- HomeSkillet Records
- How To
- Inspiration
- Internet
- JavaScript
- Marketing
- Microsoft
- Partners
- PDX
- Plug-Ins
- Portfolio
- Print Design
- Pub-Love
- Ruby On Rails
- Standards
- SXSW
- Uncategorized
- Usability
- We The Media
- Web Design
- Web Services
- XHTML
















James June 21st, 2006 at 10:59 pm
Good post man. I plan on using that Flickr feed myself soon so that hack you found could come in handy. But my standards are only XHTML Transitional. I can’t wait to see what else you have up your sleeve.