title: Ajax JSON Request fails
body: <p>I created a simple rest service which serves me JSONs. I can access it trough the browser via <code>http://localhost:8080/WebTodo/rest/todos</code> and get a list with ToDos in JSON. (It was this tutorial: <a href="http://www.vogella.com/articles/REST/article.html#crud" rel="nofollow">http://www.vogella.com/articles/REST/article.html#crud</a>)</p>
  
  <p>Now I want to get the JSONs via Jquery using this simple html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"&gt;&lt;/script&gt;
     &lt;script&gt;
  
  function getJsonFunc() {
         console.log("find all");
          $.ajax({
              type: "GET",
              url: "http://localhost:8080/WebTodo/rest/todos",
              contentType: "application/json",
              dataType: "json",
            success: function (data, status, jqXHR) {
              alert('Success')
           },
            error: function (jqXHR, status) {
            alert('Error')
           }
      });
     }
  
     function writeJson(todo) {
  
                console.log("after json");
                  var items = [];
                  $.each( todo, function( key, val ) {
                  items.push( "&lt;li id='" + key + "'&gt;" + val + "&lt;/li&gt;" );
                  });
                  $( "&lt;ul/&gt;", {
                  "class": "my-new-list",
                  html: items.join( "" )
                  }).appendTo( "body" );
  
  
     }
     &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
        &lt;button id="search" onClick="getJsonFunc()"&gt;get&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This always returns me the Error alert. I already tried with different browsers and also disabled the same origin policy in Chrome to try it. Nothing helped. What am I missing here?</p>
  
  <p>This is the acutal json which I receive in the browser <code>{"todo":[{"description":"Description","done":"false","titel":"Do something","uri":"2"},{"description":"Description","done":"false","titel":"Learn REST","uri":"1"}]}</code></p>