0

I have an activex plugin here: http://reboltutorial.com/plugins/logo-badge/

I tried by adapting the script http://forums.devarticles.com/javascript-development-22/detecting-activex-objects-installed-in-ie-11041.html to

<script>
//if RPluginIE is not installed
if( !document.RPluginIE){
document.location.href = "Notfound.html"
}
</script>

but it doesn't work.

How to detect for any activex ?

2
  • There are some syntax errors in your code, like document.loction.href Commented May 26, 2010 at 5:42
  • thanks It was a copy and paste from the other site. I corrected. Commented May 26, 2010 at 18:53

1 Answer 1

1

First of all, use a proper method for testing

// read more on http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting
function isHostMethod(object, property){
    var t = typeof object[property];
    return t == 'function' ||
        (!!(t == 'object' && object[property])) ||
        t == 'unknown';
}

Then your code would look like

if(!isHostMethod(window", "RPluginIE"){
     document.location.href = "Notfound.html";
}

Note that its the window we check, not the document.

Sign up to request clarification or add additional context in comments.

1 Comment

Really great article, I couldn't find it while searching google, thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.