title: jQuery.ajax Response is empty or undefined
body: <p>Hi I hava a big problem. I have to get some JSON form <em>localhost:8080</em>.</p>
  
  <p>The server side is a restful based jax-rs server.</p>
  
  <pre><code>@Path( "/m" )
  public class M {
    @GET
    @Path( "{id: [a-z]{1,4}-\\d{1,4}}" )
    @Produces( "application/json" )
    public Response getCar ( @PathParam( "id" ) final String id ) {
      final ResponseBuilder builder;
      builder = Response.ok( "{\"one\":\"bla\"}" );
      return builder.build();
    }
  }
  </code></pre>
  
  <p>For the same origin policy I have the following script on <strong>localhost:8080/js/script.js</strong></p>
  
  <pre><code>function test (file) {
      $.ajax( {
          type: 'GET',
          url: file + '?callback=?',
          dataType: 'json',
          success: function (data) {
              alert( 'works' );
          }
      } );
  }
  </code></pre>
  
  <p>I don't like the '?callback=?' part, but without this the response is empty (HTTP-Body).</p>
  
  <p>The problem now is, that the success method will never executed. When I change dataType to "script", the method will be called but the passed argument (data) is undefined. So what I do wrong?</p>