Tag Archives: validation

XHTML Strict validation or target attribute?

Recently I found that some of my pages were not of valid XHTML Strict doctype and the culprit is the target attribute in my tag which I used to open external pages in new window.

With a little bit of googling I found that I was not the only one who is facing this issue. In addition to that I also found lot of hacks and JavaScript scripts to make the links open in a new window without using the target attribute. Notable among them are this Sitepoint article and the recent one by Roger.

Time to decide, whether I have to the remove target attribute or use these JavaScript hacks or make my XHTML documents as transitional doctype. I am certainly not interested to use the JavaScript hacks but at the same time don’t want to go back to transitional doctype also.

Since this is my personal site I had the liberty to choose what ever I wanted and I have decided to leave it as it is. But my decision would have been different (or would have taken more time) if it was one of my client’s pages. So here after all my pages will have the XHTML Strict doctype and also the target attribute. After all rules are meant to be broken right 😉 what do you guys say?

Posted in Web Programming | Tagged , , , | 6 Comments