I have the following code whereby an Exception is thrown even after check to prevent an exception from being thrown.
In this code, if function setupSearchBar() is not defined, then do not call this function:
However, what occurs is an Exception is thrown from the if conditional statement because setupSearchBar is not defined:Code:function setupSearchOnLoad() { try { if (setupSearchBar != undefined) { setupSearchBar(); } } catch (ex) { alert("setupSearchOnLoad: Exception: "+ex.name+": "+ex.message); } }
Exception.error: ReferenceError
Exception.message: "setupSearchBar is not defined"
Why would this occur?
Jeff in Seattle


Reply With Quote

Bookmarks