title: Jquery cross domain ajax request always error
body: <p>I am trying a to create a simple Jquery mobile application. 
  My set up is as follows:</p>
  
  <ol>
  <li>jQuery client is running on <strong>localhost:9090/myapp</strong>.</li>
  <li>My server is running on <strong>localhost:9010/paperboy</strong></li>
  <li>Since I am on windows, on the server side I am using a simple server creating using "<strong>bottle</strong>" which is a python micro framework.</li>
  <li>The server returns json on request, which I can clearly see in Chrome or Firefox.</li>
  <li>I have validated my response and it is a valid JSON.</li>
  </ol>
  
  <p>The problem I am facing is, that I want my client to read the json from the server response.<br/>
  But since its a crossdomain issue, it is not able to do so.<br/>
  Here is my ajax code for the client: <br/></p>
  
  <pre><code>$.ajax({
          url: "http://localhost:9010/paperboy/toi",
          type:"GET",
          data:$(this),
          dataType:"jsonp",
          //jsonp:"callback",   no support on the server
  
          success:function(result){
              console.log("ajax result: " + result);
          },
  
          error:function(e){
              console.log("Error :" + e);
          }
      });
  </code></pre>
  
  <p>and my bottle Server code is:</p>
  
  <pre><code>from bottle import route, run, template, response
  from paperboy import getToiNews
  
  ''' call http://localhost:9010/paperboy/toi in browser'''
  
  @route('/paperboy/:source')
  def index(source='All'):
      print "requesting news list for %s" % source
      resultJson = getToiNews()
      response.content_type = "application/javascript"
      return resultJson
  
  run(host='localhost', port=9010)
  </code></pre>
  
  <p>However on running the application I initially was getting "ajax origin policy error" which soon went away once I added the content type to my server.<br/>
  Now the ajax call goes through without errors, but always invokes the "error" handler. I have tried various combinations but all in vain. One thing I could not figure out is adding jsonp support to my server.<br/>
  I appreciate any help in this matter and thank you in advance for all the help.<br/>
  Thanks.</p>