title: Javascript error handling is not working
body: <p>I'm trying to catch Ajax error using error handling try/catch but it's not working. Here's my code:</p>
  
  <pre><code>var ajaxrequest=null
  if (window.ActiveXObject){ 
   try {
    ajaxrequest=new ActiveXObject("Msxml2.XMLHTTP")
   } 
   catch {
    try{
     ajaxrequest=new ActiveXObject("Microsoft.XMLHTTP")
    } //end inner try
    catch {
     alert("NOT WORKING!!")
    } //end inner catch
   } //end outer catch
  }
  else if (window.XMLHttpRequest) // if Mozilla, Safari etc
   ajaxrequest=new XMLHttpRequest()
  
  ajaxrequest.open('GET', 'inventory.php', true) //do something with request
  </code></pre>
  
  <p>What did I do wrong?</p>