Javascript to check if there is flash player installed and redirect to the neededn page.

Posted by themajiks on Stack Overflow See other posts from Stack Overflow or by themajiks
Published on 2011-03-10T07:59:58Z Indexed on 2011/03/10 8:10 UTC
Read the original article Hit count: 184

Hi. I have this script. This determines if there is a flash player installed in the browser, it redirects the browser to a flash website. if not, then it opens a non-flash website.

The Code is here:

 <SCRIPT LANGUAGE="JavaScript">
    <!-- 
    if ((navigator.appName == "Microsoft Internet Explorer" &&
        navigator.appVersion.indexOf("Mac") == -1 &&   navigator.appVersion.indexOf("3.1") == -1) ||

    (navigator.plugins && navigator.plugins["Shockwave Flash"])|| navigator.plugins["Shockwave Flash 2.0"]){
    window.location='flash/index.html';
}
else {
    window.location='index.html';
}
-->
</SCRIPT>

What i want is to embed this code in the non-flash index page. it should just check if there is no flash then simply go with the current index file that already has been opened, or if there is no flash player, then load the index file from within the flash website.

Currently, when index.html (non-flash) is opened, it goes into loop and keeps on checking for the flash player. Can I modify the window.location='index.html'; statement no to load any file here, just go on with the file already opened.??

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about redirect