The following example uses the $find method to check whether a custom component exists and to notify the user if the component is missing.
function checkComponent() {
if (!($find('MyComponent', div1))) {
div1.innerHTML = 'MyComponent is not available.';
}
}