2

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.

e.s
  • 214
  • 3
  • 16

1 Answers1

8

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

if ('FunctionName' in window.external){
    window.external.FunctionName(...);
}
e.s
  • 214
  • 3
  • 16