问题
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.
回答1:
I found the way, Just using the 'in' operator like this:
if ('FunctionName' in window.external){
window.external.FunctionName(...);
}
来源:https://stackoverflow.com/questions/42226772/how-can-i-check-if-function-exists-on-window-external