Click here to Skip to main content
16,017,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have a page which makes use of Silverlight Isolated Storage. Now, when my page loads, it shows a hyperlink button that redirects the user to Silverlight download page (if he doesn't have it installed).

How can I prevent this link from coming at all? Like not just hiding it, how do I completely prevent it?
Posted
Comments
Ron Beyer 14-Jan-14 14:17pm    
How do you expect silverlight isolated storage to work if the user doesn't have silverlight installed? Would you skip using any of your silverlight components/storage? Need more information about what you want the alternative action to be.

1 solution

To find if there is Silverlight use this JS
JavaScript
function hasSilverlight() {
    try {
        try {
            // IE
            var AgControl = new ActiveXObject('AgControl.AgControl');

            return (true);
        }
        catch (e) {
            // Others
            if (navigator.plugins["Silverlight Plug-In"]) {
                return(true);
            }
        }
    }
    catch (e) {
        return (false);
    }
}

If the function returns true, then remove dom element...
JavaScript
var el = document.getElementById("button_id");
el.parentNode.removeChild(el);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900