ClientSide Error Handling...

  • Thread starter Thread starter Jorell
  • Start date Start date
J

Jorell

Hi everyone,

(Using javascript)
Here is my dillemma. I have an Active X control on the
page. And in the Page load I access 2 of its properties.
The issue is if the user has the option to turn off the
downloading of signed Active X controls. If this happens
the page throws a Runtime Error which states somthing to
the effect: Object does not have this property or method.

I have tried Using this to fail gracefully:

function handleError()
{
return true;
}

window.onerror = handleError;

But this does not catch this error. If anyone could please
shed some light on this issue. I just would like the page
to either fail silently or be able to write a custom
message. Thanks in advance!

Jorell
 
Hmmm, interesting.. well, all that I have been able to find so far is to do
a try/catch block, or try to load an ActiveX control using the new
ActiveXControl() method and see if it errors out.

HTH,
Bill P.
 
you just check if the control is loaded and ready before trying to access
it.

myCtl = document.getElementById('myCtl');
if (myCtl && myCtl.readyState == 4)
{
// its safe to access control
}


-- bruce (sqlwork.com)
 
Back
Top