Skip to content Skip to sidebar Skip to footer

How Can I Check If Function Exists On Window.external

How can I check if function exists on window.external? I'm calling C# code from javascript and I want to check if a method exists in the C# object.

Solution 1:

I found the way, Just using the 'in' operator like this:

if ('FunctionName' in window.external){
    window.external.FunctionName(...);
}

Post a Comment for "How Can I Check If Function Exists On Window.external"