title: how to return message to ajax?
body: <p>my ajax code:</p>
  
  <pre><code>$.ajax({
          type: 'POST',
    url: URL + "xyz/" ,
    data: {"email": email},
    success: function(data) { 
     alert('hello')
      },
       dataType: "json",
       });
  </code></pre>
  
  <p>my handler in python + bottle framework:</p>
  
  <pre><code>def index():
      if request.POST == XMLHttpRequest:
          email = request.GET.get('email')
          response.COOKIES['email'] = email
          if check_email(email): //a method written for checking email
       return some template
          else:
              return False //here i want to return some error message to ajax. How to 
  </code></pre>
  
  <p>do it? And How to caught the error in ajax.</p>
  
  <p>throwing error: NameError("global name 'XMLHttpRequest' is not defined",)
  is bottle support it? </p>