Like many, I use FeedBurner to handle the RSS feeds for this blog, which gives me the benefit of all of FB’s special features, including detailed statistics on my feed’s usage.
I also make use of its email subscription service to allow people not familiar with feed technology to subscribe to the blog and have updates delivered to their inbox (Publicise > Email Subscriptions in your FeedBurner account).
My recent redesign means that my pages are now served as XHTML 1.1, rather than 1.0 Transitional*.
The code that I use in the sidebar to show the email subscription box (the code provided by FeedBurner) won’t validate under XHTML 1.1, though, which annoyed me. So, I fixed it.
You may wonder why anyone in their right mind would care if a little snippet of code doesn’t quite validate, since it doesn’t make any user-visible difference. Aesthetics are one reason and also some mobile browsers can be really fussy about validation.
So here’s how to use my fixed code if you want to have the email subscribe feature – but also have valid XHTML 1.1 markup.
First of all, log in to FeedBurner, click the relevant feed and go to Publicise > Email Subscriptions. Under Subscription Management, there should be a box with the default code, which should be something like this (line breaks added by me for readability):
xxxxx and [[Name of the feed here]] will obviously be specific to your feed’s ID and name.
The problem with this in XHTML 1.1 is the use of the ‘target’ attribute on the form to redirect the form posting into a pop-up window, since ‘target’ is not allowed.
You don’t need to actually POST this form, though. If you load http://www.feedburner.com/fb/a/emailverifySubmit?feedIdemail@example.com via GET, the rest of the subscription process works just as it is meant to.
Because we can do it via GET, we don’t need to do the POST-to-a-popup voodoo.
Therefore, I change the first line of that code snippet to the following: