5 November 2009 5 Comments

Bing and XHTML

http://markbeljaars.com/wp-content/plugins/sociofluid/images/digg_48.png http://markbeljaars.com/wp-content/plugins/sociofluid/images/reddit_48.png http://markbeljaars.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://markbeljaars.com/wp-content/plugins/sociofluid/images/delicious_48.png http://markbeljaars.com/wp-content/plugins/sociofluid/images/furl_48.png http://markbeljaars.com/wp-content/plugins/sociofluid/images/technorati_48.png http://markbeljaars.com/wp-content/plugins/sociofluid/images/facebook_48.png http://markbeljaars.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://markbeljaars.com/wp-content/plugins/sociofluid/images/mixx_48.png http://markbeljaars.com/wp-content/plugins/sociofluid/images/twitter_48.png

It’s official. Microsoft loves XHTML compliant web pages! Well formed documents can be consistently displayed, searched, indexed, sorted and so on. Microsoft even entertained the idea of enforcing XHTML compliance in IE8. I guess it stands to reason that Bing will also prefer well formed web pages. If Bing becomes popular, it may be the catalyst used to sway developers to create well-formed XHTML web pages.

I therefore set out on a wonderful adventure to remove all XHTML errors and warnings from one of my sites.The finished error free page can be found at http://beginnerchess.org if anyone is interested.

Interestingly, I found three problems that would affect many people using Wirdoress 2.8 and above.

  1. Google adsense code snippets actually break wordpress. WordPress converts the closing CDATA bracket to > (not >). To fix, remove the CDATA section and replace with comment tags. eg:

    google_script

  2. Also, the wordpress 2.8 search facility is not well formed. If you can be bothered, modify wp-includes/general-templates.php and remove any reference to role=”search”.
  3. Finally, make sure your theme has <ul> and </ul> tags around any calls to dynamic_sidebar (normally found in sidebar.php or functions.php files).

Also note that embedded flash files are not XHTML complient. There have been attempts to display flash using conforming tags, but I’ve found them not be reliable. Stick with non-compliant code for now.

To test your web page, visit http://validator.w3.org/

Related Posts

5 Responses to “Bing and XHTML”

  1. Bryan Brazil 5 December 2009 at 10:41 pm #

    http://www.bryanbrazil.com/?p=764

    Hmm, after checking my page in Browser Shots, maybe my code doesn’t work in all browsers. Can’t tell for sure, I didn’t select “flash enabled” when I checked my url the first time.

    Is Browser Shots fairly accurate? My site came up blank in several browsers, that can’t be right.

    • admin 6 December 2009 at 12:57 am #

      I found that Browser Shots sometimes times out and returns a blank page. If you re-run the test again with fewer browsers selected it often returns the correct results. IE5 and 6 seem to do this often. Thanks for the link BTW.

  2. Bryan Brazil 5 December 2009 at 3:19 pm #

    Uh oh, looks like the code didn’t post…if you’re interested I can post the code to my site.

    • admin 5 December 2009 at 3:51 pm #

      Hi Bryan. Yes I would be very interested. I started out by tring to make all of my websites XHTML compliant and gave up in the end as even WordPress itself was not. Maybe they have fixed this now though. If you don’t want to put the code on your site, you could email the code to me and I can knock up a quick blog post (with credit to you of course).
      By the way, you mentioned that you have tested on several browsers. Do you use Browser Shots? This is a great free site that will run a URL on dozens of different browsers and send you screen shots of what it looks like. I use this service to test what my plugin will look like on different browsers.

  3. Bryan Brazil 5 December 2009 at 3:18 pm #

    Regarding XHTML compliant flash: I finally found a way to embed flash YouTube movies in my site that validates XHTML 1.0 Strict. I just use the following format:

    Tested in IE 8, Firefox, Chrome, Safari.


Leave a Reply


SpinChimp Leaderboard 728x90