Catching the 'Object Expected' Error : Error Exceptions : Development JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Development » Error Exceptions »

 

Catching the 'Object Expected' Error



<HTML>
<BODY>
<H1>
<SCRIPT
function dosomething() { 


function goodFunc(){ 
   try 
      doSomething()
   
   catch (e) { 
      if (e.description == "Object expected") { 
         alert("Cannot find a function named doSomething!")
      
      else 
         alert ("Other error" + e.description)
      
   

</SCRIPT>
</H1>
<FORM>
<INPUT type=button value="Click" onClick="goodFunc();">
</FORM>
</BODY>
</HTML>

           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Development
» Error Exceptions