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 8470327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:29:08+00:00 2026-06-10T16:29:08+00:00

This is a function used to detect VML support in browsers. It’s part of

  • 0

This is a function used to detect VML support in browsers. It’s part of an html component file for giving border-radius and drop-shadow functionality to older versions of IE. I would like this explained to me, the step-by-step logic of it:

function supportsVml() {
    if (typeof supportsVml.supported == "undefined"){
        var a = document.body.appendChild(document.createElement('div'));
        a.innerHTML = '<v:shape id="vml_flag1" adj="1" />';
        var b = a.firstChild;
        b.style.behavior = "url(#default#VML)";
        supportsVml.supported = b ? typeof b.adj == "object": true;
        a.parentNode.removeChild(a);
    }

    return supportsVml.supported
}

Where I am confused:

  1. What is supporstVml.supported? Is this a variable, I don’t see it declared anywhere else int he file…
  2. what is the url(#default#VML) behavior?
  3. supportsVml.supported is reassigned a new value based on the conditional, but I have no idea what or why…

Thanks!

  • 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-10T16:29:10+00:00Added an answer on June 10, 2026 at 4:29 pm

    supportsVml.supported is a property of the function, which is used just as a caching for the result.

    If it is undefined (before the first call), the detection algorithm is run. Afterwards just the cached value is used and the detection is omitted.

    The actual detection algorithm tries to add a default VML element and checks, whether this is inserted correctly. If so, VML is supported.

    EDIT

    The behavior can attach scripts to the CSS of an element (link). As far as I know, this is unique to older IE versions.

    supportsVml.supported = b ? typeof b.adj == "object": true;
    

    This line uses a ternary operator. It could be rewritten as follows:

    if ( b ) {
      if ( b.adj == 'object' ) {
        supportsVml.supported = true;
      } else { 
        supportsVml.supported = false;
      }
    } else {
      supportsVml.supported = true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use this function: http://www.frankmacdonald.co.uk/php/post-to-wordpress-with-php.html Its used to post to Wordpress using
Possible Duplicate: HTML Text Input allow only Numeric input I used this script function
I am working with the PHP explode function. This function is used to detect
I am using following code to get bitmap from url. This function is used
I have used this function to convert string to bits. def a2bits(chars): return bin(reduce(lambda
I have a problem when call applet method from javascript.. I used this function
I have used Javascript onlaod like this: function check() { var pic = new
I'm used to Java so when i try to so something like this: function
I'm trying to remove the eval statement in this function. I'm used to the
I used a code: jQuery.fn.MyFunction = function(){ return this.each(function() { attributes = test; return

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.