title: ajaxt weird error: Uncaught SyntaxError: Unexpected token if
body: <p>I have this javascript:</p>
  
  <pre><code>function updatePage() {   
  if (request.readyState == 4)
      if (request.status == 200)
          var data = JSON.parse(request.responseText);
          update_select($('select[name=island_name]'), data);
      else if (request.status == 404)
          alert("Request url does not exist");
      else
          alert("Error: status code is " + request.status);
  }  
  </code></pre>
  
  <p>But I keep getting a<code>Uncaught SyntaxError: Unexpected token if</code> error which halts my script. Any ideas?</p>