title: Flask Python String Not Returning Back To Javascript XMLHttpRequest call
body: <p>I have a Javacscript XMLHttpRequest call which calls python app.py(using flask). The python script myapp.py returns "Hello World". I see in Chromium Debug that is is returning "hello world". But it's not being return to the Javascript XMLHttpRequest in the responsetext value. </p>
  
  <p>Here is my javascript code:</p>
  
  <pre><code>function foo() {
      var xml = new XMLHttpRequest();
      xml.open("GET", "/myapp/web.py", true);
      xml.send(null);
      var text = xml.responseText;
      alert(text);
  
  }
  </code></pre>
  
  <p>Here is the python script:</p>
  
  <pre><code>flask python # cat myapp.py
  from flask import Flask
  app = Flask(__name__)
  
  
  @app.route('/', defaults={'path': ''})
  @app.route('/&lt;path:path&gt;')
  def catch_all(path):
      return "hello world"
  
  #@app.route('/')
  def hello_world():
      return 'Hello World!'
  
  if __name__ == '__main__':
      app.run()
  </code></pre>