How can I verify if a function was defined already?
Will this work?
if(window.opener.MyFunctionBlah) { ... }
if (typeof yourFunctionName === 'function') {
yourFunctionName();
}
window.opener even if MyFunctionBlar is a function. In IE typeof window.opener.MyFunctionBlar will be object.Yes. Functions are just properties of objects like any other, so you can treat them as such. The conditional you posted above will return true if that function (or any member of window.opener called MyFunctionBlah) is defined and non-null.