I see a very common boilerplate pattern for bookmarklet code:
javascript:var%20b=document.body;if(b&&!document.xmlVersion){void(/*do_something_AWESOME_here*/);}else{}
What is the reasoning behind including the !document.xmlVersion check? Is it simply a matter of excluding older browsers? Verifying that we are in an HTML document, and not an XML doc? The documentation does not exactly clarify matters… I have not been able to find any explanatory statements on this – it mostly looks like a case of copyandpasteitus.
Updated 5/21/2012 to include link to Google search for pattern
as the document suggests it was required for the older versions to check if the document was being rendered as xml rather than html. now its of no use in the latest versions of the browsers. IT is not used in the recent versions of the browsers.