Unexpected Exception thrown, even after check.
Posted: Tue Sep 29, 2009 12:46 pm
I have the following code whereby an Exception is thrown even after check.
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:
Exception.error: ReferenceError
Exception.message: "setupSearchBar is not defined"
Why would this occur?
Jeff in Seattle
In this code, if function setupSearchBar() is not defined, then do not call this function:
Code: Select all
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