Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7960175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:41:14+00:00 2026-06-04T04:41:14+00:00

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

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:41:15+00:00Added an answer on June 4, 2026 at 4:41 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a lot of code, it's very common to see an init function be
A very common pattern I see (I'm picking on Zend Framework, only because I
Here's a common practice I see often (including from a very popular iPhone developer
I see that in Ruby (and dynamically typed languages, in general) a very common
User Login functionality is very common to many applications. I would like to see
This is a very common usecase we see on stackoverflow, facebook, etc. You often
There's a very common pattern in the implementation of many functions in the haskell
Yes. my problem is very common in StackOverFlow, but I don't see the real
Java methods accepting and returning Iterable<T> types are very common. The problem I see
Important : Please see this very much related question: Return multiple values in C++

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.